1YAZ-ICU(1) [FIXME: manual] YAZ-ICU(1)
2
3
4
6 yaz-icu - YAZ ICU utility
7
9 yaz-icu [commands...] [-c config] [-p opt] [-s] [-x]
10
12 yaz-icu is utility which demonstrates the ICU chain module of yaz.
13 (yaz/icu.h).
14
16 -c config
17 Specifies the file containing ICU chain configuration which is XML
18 based.
19
20 -p type
21 Specifies extra information to be printed about the ICU system. If
22 type is c then ICU converters are printed. If type is l available
23 locales are printed. If type is t available transliterators are
24 printed.
25
26 -s
27 Specifies that output should include sort key as well. Note that
28 sort key differs between ICU versions.
29
30 -x
31 Specifies that output should be XML based rather than "text" based.
32
34 The ICU chain configuration speicifies one or more rules to convert
35 text data into tokens. The configuration format is XML based.
36
37 The toplevel element must be named icu_chain. The icu_chain element has
38 one required attribute locale which specifies the ICU locale to be used
39 in the conversion steps.
40
41 The icu_chain element must include elements where each element
42 specifies a conversion step. The conversion is performed in the order
43 in which the conversion steps are specified. Each conversion element
44 takes one attribute: rule which serves as argument to the conversion
45 step.
46
47 The following conversion elements are available:
48
49 casemap
50 Converts case and rule specifies how:
51
52 l
53 Lowercase using ICU function u_strToLower.
54
55 u
56 Upper case using ICU function u_strToUpper.
57
58 t
59 To title using UCU function u_strToTitle.
60
61 f
62 Fold case using ICU function u_strFoldCase.
63
64
65 display
66 This is a meta step which specifies that a term/token is to be
67 displayed. This term is retrieved in an application using function
68 icu_chain_token_display (yaz/icu.h).
69
70 transform
71 Specifies an ICU transform rule using a transliterator Identifier.
72 The rule attribute is the transliterator Identifier. See ICU
73 Transforms[1] for more information.
74
75 transliterate
76 Specifies a rule-based transliterator. The rule attribute is the
77 custom transformation rule to be used. See ICU Transforms[1] for
78 more information.
79
80 tokenize
81 Breaks / tokenizes a string into components using ICU functions
82 ubrk_open, ubrk_setText, .. . The rule is one of:
83
84 l
85 Line. ICU: UBRK_LINE.
86
87 s
88 Sentence. ICU: UBRK_SENTENCE.
89
90 w
91 Word. ICU: UBRK_WORD.
92
93 c
94 Character. ICU: UBRK_CHARACTER.
95
96 t
97 Title. ICU: UBRK_TITLE.
98
99
101 The following command analyzes text in file text using ICU chain
102 configuration chain.xml:
103
104 cat text | yaz-icu -c chain.xml
105
106
107 The chain.xml might look as follows:
108
109 <icu_chain locale="en">
110 <transform rule="[:Control:] Any-Remove"/>
111 <tokenize rule="w"/>
112 <transform rule="[[:WhiteSpace:][:Punctuation:]] Remove"/>
113 <transliterate rule="xy > z"/>
114 <display/>
115 <casemap rule="l"/>
116 </icu_chain>
117
118
119
120
122 yaz(7)
123
124 ICU Home[2]
125
126 ICU Transforms[1]
127
129 1. ICU Transforms
130 http://www.icu-project.org/userguide/Transform.html
131
132 2. ICU Home
133 http://www.icu-project.org/
134
135
136
137YAZ 4.0.2 03/09/2010 YAZ-ICU(1)