Doc: update to DB 4.4. More metadata for man pages
[yaz-moved-to-github.git] / doc / yaz-icu-man.xml
1 <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook V4.4//EN"
2  "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd"
3 [
4      <!ENTITY % local SYSTEM "local.ent">
5      %local;
6      <!ENTITY % entities SYSTEM "entities.ent">
7      %entities;
8      <!ENTITY % idcommon SYSTEM "common/common.ent">
9      %idcommon;
10 ]>
11 <refentry id="yaz-icu">
12  <refentryinfo>
13   <productname>YAZ</productname>
14   <productnumber>&version;</productnumber>
15   <info><orgname>Index Data</orgname></info>
16  </refentryinfo>
17  
18  <refmeta>
19   <refentrytitle>yaz-icu</refentrytitle>
20   <manvolnum>1</manvolnum>
21   <refmiscinfo class="manual">Commands</refmiscinfo>
22  </refmeta>
23  
24  <refnamediv>
25   <refname>yaz-icu</refname>
26   <refpurpose>YAZ ICU utility</refpurpose>
27  </refnamediv>
28
29  <refsynopsisdiv>
30   <cmdsynopsis>
31    <command>yaz-icu</command>
32    <arg choice="opt" rep="repeat">commands</arg>
33    <arg>-c <replaceable>config</replaceable></arg>
34    <arg>-p <replaceable>opt</replaceable></arg>
35    <arg>-s</arg>
36    <arg>-x</arg>
37   </cmdsynopsis>
38  </refsynopsisdiv>
39  
40  <refsect1><title>DESCRIPTION</title>
41   <para>
42    <command>yaz-icu</command> is utility which demonstrates 
43    the ICU chain module of yaz. (<filename>yaz/icu.h</filename>).
44   </para>
45  </refsect1>
46
47  <refsect1><title>OPTIONS</title>
48   <variablelist>
49    <varlistentry>
50     <term>-c <replaceable>config</replaceable></term>
51     <listitem><para>
52       Specifies the file containing ICU chain configuration
53       which is XML based.
54      </para></listitem>
55    </varlistentry>
56
57    <varlistentry>
58     <term>-p <replaceable>type</replaceable></term>
59     <listitem><para>
60       Specifies extra information to be printed about the ICU system.
61       If <replaceable>type</replaceable> is <literal>c</literal>
62       then ICU converters are printed. 
63       If <replaceable>type</replaceable> is <literal>l</literal>
64       available locales are printed.
65       If <replaceable>type</replaceable> is <literal>t</literal>
66       available transliterators are printed.
67      </para></listitem>
68    </varlistentry>
69
70    <varlistentry>
71     <term>-s</term>
72     <listitem><para>
73       Specifies that output should include sort key as well. Note that
74       sort key differs between ICU versions.
75      </para></listitem>
76    </varlistentry>
77
78    <varlistentry>
79     <term>-x</term>
80     <listitem><para>
81       Specifies that output should be XML based rather than
82       "text" based.
83      </para></listitem>
84    </varlistentry>
85
86   </variablelist>
87  </refsect1>
88  <refsect1><title>ICU chain configuration</title>
89   <para>
90    The ICU chain configuration speicifies one or more rules to convert
91    text data into tokens. The configuration format is XML based.
92   </para>
93   <para>
94    The toplevel element must be named <literal>icu_chain</literal>.
95    The <literal>icu_chain</literal> element has one required attribute
96    <literal>locale</literal> which specifies the ICU locale to be used
97    in the conversion steps.
98   </para>
99   <para>
100    The <literal>icu_chain</literal> element must include elements where
101    each element specifies a conversion step. The conversion is performed
102    in the order in which the conversion steps are specified.
103    Each conversion element takes one attribute: <literal>rule</literal>
104    which serves as argument to the conversion step.
105   </para>
106   <para>
107    The following conversion elements are available:
108    
109    <variablelist>
110     <varlistentry>
111      <term>casemap</term>
112      <listitem><para>
113        Converts case and rule specifies how:
114
115        <variablelist>
116         <varlistentry>
117          <term>l</term>
118          <listitem>
119           <para>Lowercase using ICU function u_strToLower. </para>
120          </listitem>
121         </varlistentry>
122
123         <varlistentry>
124          <term>u</term>
125          <listitem>
126           <para>Upper case using ICU function u_strToUpper.</para>
127          </listitem>
128         </varlistentry>
129         
130         <varlistentry>
131          <term>t</term>
132          <listitem>
133           <para>To title using UCU function u_strToTitle.</para>
134          </listitem>
135         </varlistentry>
136
137         <varlistentry>
138          <term>f</term>
139          <listitem>
140           <para>Fold case using ICU function u_strFoldCase.</para>
141          </listitem>
142         </varlistentry>
143         
144        </variablelist>
145       </para></listitem>
146     </varlistentry>
147
148     <varlistentry>
149      <term>display</term>
150      <listitem><para>
151        This is a meta step which specifies that a term/token is to
152        be displayed. This term is retrieved in an application
153        using function icu_chain_token_display (<filename>yaz/icu.h</filename>).
154       </para></listitem>
155     </varlistentry>
156     
157     <varlistentry>
158      <term>transform</term>
159      <listitem><para>
160        Specifies an ICU transform rule using a transliterator
161        Identifier.
162        The rule attribute is the transliterator Identifier.
163        See  <ulink url="&url.icu.transform;">ICU Transforms</ulink> for
164        more information.
165       </para></listitem>
166     </varlistentry>
167     
168     <varlistentry>
169      <term>transliterate</term>
170      <listitem><para>
171        Specifies a rule-based transliterator.
172        The rule attribute is the custom transformation rule to be used.
173        See <ulink url="&url.icu.transform;">ICU Transforms</ulink> for
174        more information.
175       </para></listitem>
176     </varlistentry>
177     
178     <varlistentry>
179      <term>tokenize</term>
180      <listitem><para>
181        Breaks / tokenizes a string into components using
182        ICU functions ubrk_open, ubrk_setText, .. . The rule is
183        one of:
184        <variablelist>
185         <varlistentry>
186          <term>l</term>
187          <listitem>
188           <para>Line. ICU: UBRK_LINE.</para>
189          </listitem>
190         </varlistentry>
191
192         <varlistentry>
193          <term>s</term>
194          <listitem>
195           <para>Sentence. ICU: UBRK_SENTENCE.</para>
196          </listitem>
197         </varlistentry>
198         
199         <varlistentry>
200          <term>w</term>
201          <listitem>
202           <para>Word. ICU: UBRK_WORD.</para>
203          </listitem>
204         </varlistentry>
205
206         <varlistentry>
207          <term>c</term>
208          <listitem>
209           <para>Character. ICU: UBRK_CHARACTER.</para>
210          </listitem>
211         </varlistentry>
212
213         <varlistentry>
214          <term>t</term>
215          <listitem>
216           <para>Title. ICU: UBRK_TITLE.</para>
217          </listitem>
218         </varlistentry>
219
220        </variablelist>
221       </para></listitem>
222     </varlistentry>
223     
224    </variablelist>
225    
226   </para>
227  </refsect1>
228  <refsect1><title>EXAMPLES</title>
229   <para>
230    The following command analyzes text in file <filename>text</filename>
231    using ICU chain configuration <filename>chain.xml</filename>:
232    <screen>
233     cat text | yaz-icu -c chain.xml
234    </screen>
235    The chain.xml might look as follows:
236     <screen><![CDATA[
237 <icu_chain locale="en">
238   <transform rule="[:Control:] Any-Remove"/>
239   <tokenize rule="w"/>
240   <transform rule="[[:WhiteSpace:][:Punctuation:]] Remove"/>
241   <transliterate rule="xy > z"/>
242   <display/>
243   <casemap rule="l"/>
244 </icu_chain>
245 ]]>
246    </screen>
247   </para>
248  </refsect1>
249  <refsect1><title>SEE ALSO</title>
250   <para>
251    <citerefentry>
252     <refentrytitle>yaz</refentrytitle>
253     <manvolnum>7</manvolnum>
254    </citerefentry>
255   </para>
256   <para>
257    <ulink url="&url.icu;">ICU Home</ulink>
258   </para>
259   <para>
260    <ulink url="&url.icu.transform;">ICU Transforms</ulink>
261   </para>
262  </refsect1>
263 </refentry>
264
265 <!-- Keep this comment at the end of the file
266 Local variables:
267 mode: sgml
268 sgml-omittag:t
269 sgml-shorttag:t
270 sgml-minimize-attributes:nil
271 sgml-always-quote-attributes:t
272 sgml-indent-step:1
273 sgml-indent-data:t
274 sgml-parent-document:nil
275 sgml-local-catalogs: nil
276 sgml-namecase-general:t
277 End:
278 -->