YAZ-ICU(1)
okay bestie, come SIT π this is yaz-icu(1) β section 1, the Commands shelf β aka the YAZ ICU utility. Yeah she's a little niche, but she's so good, I promise. Let's get into it. β¨
πΈ NAME πΈ
yaz-icu β the YAZ ICU utility. That's her. That's the whole name. Short. Iconic. π
β¨ SYNOPSIS β¨
yaz-icu [-c config] [-p opt] [-s] [-x] [infile]
Look at her, all tidy and with options π that's the vibe.
π¦ DESCRIPTION π¦
So, yaz-icu is a lil demo utility for the ICU chain module of yaz (that's yaz/icu.h, iykyk). It's basically the "here's how this works" showcase.
She can be used in two ways, and honestly, two modes? Main character energy fr fr. π
Mode one: she reads some text using an XML configuration that configures ICU, and shows you the text analysis. This mode kicks in when you pass option -c, which names the configuration to use. The input file comes from standard input, or from a file if you also give her infile.
Mode two: she shows you ICU info instead. That one's triggered by option -p. π
π OPTIONS π
-cconfig β says which file holds the ICU chain configuration, and that config is XML based.-ptype β asks for extra info to be printed about the ICU system. If type isc, then ICU converters get printed. If type isl, then the available locales get printed. If type ist, then the available transliterators get printed. β¨-sβ says the output should include the sort key as well. > β οΈ heads up bestie: sort key differs between ICU versions. Not a bug, just a fact of life, don't @ me. π-xβ says the output should be XML based instead of"text"based.
π ICU CHAIN CONFIGURATION π
The ICU chain configuration is where you lay out one or more rules that convert text data into tokens. The format? XML based, obviously. π
The toplevel element must be named icu_chain. And icu_chain has one required attribute: locale, which names the ICU locale used in the conversion steps. Required means required, bestie, no skipping. π«Ά
icu_chain must also include elements, and each element specifies a conversion step. The conversion happens in the order in which the conversion steps are specified β order matters, she's picky like that. Each conversion element takes exactly one attribute: rule, which serves as the argument to that conversion step.
The conversion elements available are:
casemapβ converts case (and therulesays how):lβ lower case, using the ICU functionu_strToLower.uβ upper case, using the ICU functionu_strToUpper.tβ to title, using the ICU functionu_strToTitle.fβ fold case, using the ICU functionu_strFoldCase.
displayβ a meta step that says a term/token is to be displayed. The term gets retrieved in an application using the functionicu_chain_token_display(yaz/icu.h). π¦transformβ specifies an ICU transform rule using a transliterator Identifier. Theruleattribute is the transliterator Identifier. See ICU Transforms[1] for more info, bestie.transliterateβ specifies a rule-based transliterator. Theruleattribute is the custom transformation rule to be used. Again, see ICU Transforms[1] for more info. πtokenizeβ breaks / tokenizes a string into components using the ICU functionsubrk_open,ubrk_setText, .. . (<- yes, that ellipsis is canon, leave her alone π). Theruleis one of:lβ Line. ICU:UBRK_LINE.sβ Sentence. ICU:UBRK_SENTENCE.wβ Word. ICU:UBRK_WORD.cβ Character. ICU:UBRK_CHARACTER.tβ Title. ICU:UBRK_TITLE.
joinβ joins tokens into one string. Theruleattribute is the joining string, and it may be empty. Lowkey a fan favourite β thejoinconversion element was added in YAZ 4.2.49. β¨
π EXAMPLES π
So this command analyzes the text in file text using the ICU chain configuration chain.xml:
cat text | yaz-icu -c chain.xml
And chain.xml might look, like, exactly like this π:
<icu_chain locale="en">
<transform rule="[:Control:] Any-Remove"/>
<tokenize rule="w"/>
<transform rule="[[:WhiteSpace:][:Punctuation:]] Remove"/>
<transliterate rule="xy > z;"/>
<display/>
<casemap rule="l"/>
</icu_chain>
Ate. No crumbs. π
β SEE ALSO β
yaz(7)- ICU Home[2]
- ICU Transforms[1]
π AUTHORS π
Index Data β yes, the whole crew. Respect. π«Ά
π NOTES π
- ICU Transforms β https://unicode-org.github.io/icu/userguide/transforms/general/
- ICU Home β https://github.com/unicode-org/icu
and that's the whole page, bestie!! this one is YAZ 5.38.1, dated 10/16/2026, and it's the yaz-icu(1) manual page β you've officially read the entire thing, and honestly? slay ππ
β¨
π¦ where this page comes from
- arch rolling: yaz 5.38.1-1 Β· LicenseRef-yaz
- fedora 44: yaz 5.38.1-1.fc44 Β· BSD-3-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms