ucto(1)
π NAME π
ucto β the Unicode Tokenizer πβ¨ (yes bestie, we're in the General Commands Manual, section 1, and this lil icon is about to become your fave)
πΈ SYNOPSIS πΈ
ucto [[options]] [inputβfile] [[outputβfile]]
π¦ DESCRIPTION π¦
okay so picture this: you got a text file and it's just⦠a wall of vibes. ucto fixes that. It tokenizes text files, which is a fancy way of saying it:
- separates words from punctuation βοΈ
- splits sentences (and optionally paragraphs, if you're feeling extra)
- finds paired quotes π―
And the best part? Ucto comes preconfigured with tokenisation rules for several languages. No cap.
Those rules? They're provided by uctodata. Thank u uctodata, you ate. π
π OPTIONS π
so many options. we love options. let's get into it, one by one, no skipping, periodt.
-cconfigfile β read your settings from a'configfile'. main character config energy.-Bβ run in batch mode. It processes all inputfiles to an output directory specified with-O.-dvalue β set debug mode to'value'. π-evalue β set input encoding. (default isUTF8) π«Ά-Ivalue β set the input directory to'value'. (batch mode only)-Ovalue β set the output directory to'value'. (Required for batch mode β like, actually required, don't come crying to me)-Nvalue β set UTF8 output normalization. (defaultNFC)--filter=[YES|NO]β disable filtering of special characters, (defaultYES). These special characters can be specified in the[FILTER]block of the configuration file. π§-Llanguage β Automatically selects a configuration file by language code. The language code is generally a three-letter iso-639-3 code. For example,'fra'will select the filetokconfigβfrafrom the installation directory. so smart of her honestly.--detectlanguages=<lang1,lang2,..langn>β try to detect all the specified languages. The default language will be'lang1'. (only useful for FoLiA output).- All values must be iso-639-3 codes.
- You can also use the special language code
und. This ensures there is NO default language, and any language that is NOT in the list will remain unanalyzed.
β οΈ Warning: To be able to handle utterances of mixed language, Ucto uses a simple sentence splitter based on the markers'.''?'and'!'. This may occasionally lead to surprising results. π not me getting jumpscared by a sentence split
-lβ Convert output text to all lowercase. whisper mode π₯Ί-uβ Convert all input text to all uppercase. SCREAM MODE π£-nβ Emit one sentence per line on output. clean. tidy. iconic.-mβ Assume one sentence per line on input. trust the input, bestie.--normalize=class1,class2,..,classnβ map all occurrences of tokens withclass1,...classto their generic names. e.g.--normalize=DATEwill map all dates to the word{{DATE}}. Very useful to normalize tokens like URL's, DATE's, E-mail addresses and so on. β¨-Tvalue or--textredundancy=valueβ set text redundancy level for text nodes in FoLiA output:'full'β add text to all levels:<p><s><w>etc.'minimal'β don't introduce text on higher levels, but retain what is already there.'none'β only introduce text on<w>, AND remove all text from higher levels.
--allow-word-correctionβ Allow ucto to tokenize inside FoLiA Word elements, creating FoLiA Corrections. glow up π«Ά--ignore-tag-hintsβ Skip alltag=tokenhints from the FoLiA input. These hints can be used to signal text markup like subscript and superscript.--add-tokens="file"β Add additional tokens to the[TOKENS]block of the default language. The file should contain oneTOKENper line. π--passthruβ Don't tokenize, but perform input decoding and simple token role detection. just vibing, no thoughts.--filterpunctβ remove most of the punctuation from the output. (not from abreviations and embedded punctuation likeJohn's). bye bye commas π-Pβ Disable Paragraph Detection.-Qβ Enable Quote Detection. (this is experimental and may lead to unexpected results) π she's trying her best okay-s<string> β Set Endβofβsentence marker. (Default<utt>)-Vor-- versionβ Show version information.-vβ set Verbose mode. she will NOT stop talking π¬-Fβ The input file(s) are assumed to be FoLiA XML. Text in the correct'inputclass'will be tokenized. For files with an'.xml'extension,-Fis the default.- In batch mode, this forces to only select files with the
'.xml'extension from the input directory.
- In batch mode, this forces to only select files with the
--inputclass="cls"β When tokenizing a FoLiA XML document, search for text nodes of class'cls'. The default is"current".--outputclass="cls"β When tokenizing a FoLiA XML document, output the tokenized text in text nodes with'cls'. The default is"current". It is recommended to have different classes for input and output.--textclass="cls"(obsolete) β use'cls'for input and output of text from FoLiA. Equivalent to both--inputclass='cls'and--outputclass='cls'.
π¨ This option is obsolete and NOT recommended. Please use the separate--inputclass=and--outputclassoptions. do not use the old one bestie i'm begging
--copyclassβ when ucto is used on FoLiA with fully tokenized text ininputclass='inputclass', no text in textclass'outputclass'is produced. (A warning will be given). To circumvent this. Add the--copyclassoption. Which assures that text will be emitted in that class. π©Ή the little fixer upper-Xβ All output will be FoLiA XML. Document id's are autogenerated.- Works in batch mode too.
--id<DocId> β Use the specified Document ID for the FoLiA XML. (not allowed in batch mode) When not provided, a document is is generated based on the nema of the input file.
π BUGS π
likely
(that's it. that's the whole bugs section. she's honest. she's humble. she's real for that. π)
π AUTHORS π
- Maarten van Gompel
- Ko van der Sloot
e-mail: lamasoftware@science.ru.nl
okay that's the whole page bestie, you're officially a tokenizing genius now πβ mwah π
anyway this lil doc? it's from the General Commands Manual, it's ucto(1), and it's dated 2024 apr 11. love that for her. bye pookie ππ
π¦ where this page comes from
- alpine 3.24: ucto-doc 0.35-r2 Β· GPL-3.0-only
- debian trixie: ucto 0.35-2+b1 Β· GPL-3.0-or-later
- nixos 26.05: ucto 0.36
- nixpkgs unstable: ucto 0.37
- ubuntu questing: ucto 0.35-2build1
- ubuntu resolute: ucto 0.35-2build2 Β· GPL-3.0-or-later
- ubuntu stonking: ucto 0.35-2build3 Β· GPL-3.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms