617406d694fb2e4fbc490d28ed7ff0d4feb74f8c
[platform/upstream/libunistring.git] / doc / libunistring_10.html
1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html401/loose.dtd">
2 <html>
3 <!-- Created on March, 30 2010 by texi2html 1.78a -->
4 <!--
5 Written by: Lionel Cons <Lionel.Cons@cern.ch> (original author)
6             Karl Berry  <karl@freefriends.org>
7             Olaf Bachmann <obachman@mathematik.uni-kl.de>
8             and many others.
9 Maintained by: Many creative people.
10 Send bugs and suggestions to <texi2html-bug@nongnu.org>
11
12 -->
13 <head>
14 <title>GNU libunistring: 10. Word breaks in strings &lt;uniwbrk.h&gt;</title>
15
16 <meta name="description" content="GNU libunistring: 10. Word breaks in strings &lt;uniwbrk.h&gt;">
17 <meta name="keywords" content="GNU libunistring: 10. Word breaks in strings &lt;uniwbrk.h&gt;">
18 <meta name="resource-type" content="document">
19 <meta name="distribution" content="global">
20 <meta name="Generator" content="texi2html 1.78a">
21 <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
22 <style type="text/css">
23 <!--
24 a.summary-letter {text-decoration: none}
25 pre.display {font-family: serif}
26 pre.format {font-family: serif}
27 pre.menu-comment {font-family: serif}
28 pre.menu-preformatted {font-family: serif}
29 pre.smalldisplay {font-family: serif; font-size: smaller}
30 pre.smallexample {font-size: smaller}
31 pre.smallformat {font-family: serif; font-size: smaller}
32 pre.smalllisp {font-size: smaller}
33 span.roman {font-family:serif; font-weight:normal;}
34 span.sansserif {font-family:sans-serif; font-weight:normal;}
35 ul.toc {list-style: none}
36 -->
37 </style>
38
39
40 </head>
41
42 <body lang="en" bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#800080" alink="#FF0000">
43
44 <table cellpadding="1" cellspacing="1" border="0">
45 <tr><td valign="middle" align="left">[<a href="libunistring_9.html#SEC37" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
46 <td valign="middle" align="left">[<a href="libunistring_11.html#SEC41" title="Next chapter"> &gt;&gt; </a>]</td>
47 <td valign="middle" align="left"> &nbsp; </td>
48 <td valign="middle" align="left"> &nbsp; </td>
49 <td valign="middle" align="left"> &nbsp; </td>
50 <td valign="middle" align="left"> &nbsp; </td>
51 <td valign="middle" align="left"> &nbsp; </td>
52 <td valign="middle" align="left">[<a href="libunistring.html#SEC_Top" title="Cover (top) of document">Top</a>]</td>
53 <td valign="middle" align="left">[<a href="libunistring.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
54 <td valign="middle" align="left">[<a href="libunistring_18.html#SEC71" title="Index">Index</a>]</td>
55 <td valign="middle" align="left">[<a href="libunistring_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
56 </tr></table>
57
58 <hr size="2">
59 <a name="uniwbrk_002eh"></a>
60 <a name="SEC38"></a>
61 <h1 class="chapter"> <a href="libunistring.html#TOC38">10. Word breaks in strings <code>&lt;uniwbrk.h&gt;</code></a> </h1>
62
63 <p>This include file declares functions for determining where in a string
64 &ldquo;words&rdquo; start and end.  Here &ldquo;words&rdquo; are not necessarily the same as
65 entities that can be looked up in dictionaries, but rather groups of
66 consecutive characters that should not be split by text processing
67 operations.
68 </p>
69
70 <hr size="6">
71 <a name="Word-breaks-in-a-string"></a>
72 <a name="SEC39"></a>
73 <h2 class="section"> <a href="libunistring.html#TOC39">10.1 Word breaks in a string</a> </h2>
74
75 <p>The following functions determine the word breaks in a string.
76 </p>
77 <dl>
78 <dt><u>Function:</u> void <b>u8_wordbreaks</b><i> (const uint8_t *<var>s</var>, size_t <var>n</var>, char *<var>p</var>)</i>
79 <a name="IDX615"></a>
80 </dt>
81 <dt><u>Function:</u> void <b>u16_wordbreaks</b><i> (const uint16_t *<var>s</var>, size_t <var>n</var>, char *<var>p</var>)</i>
82 <a name="IDX616"></a>
83 </dt>
84 <dt><u>Function:</u> void <b>u32_wordbreaks</b><i> (const uint32_t *<var>s</var>, size_t <var>n</var>, char *<var>p</var>)</i>
85 <a name="IDX617"></a>
86 </dt>
87 <dt><u>Function:</u> void <b>ulc_wordbreaks</b><i> (const char *<var>s</var>, size_t <var>n</var>, char *<var>p</var>)</i>
88 <a name="IDX618"></a>
89 </dt>
90 <dd><p>Determines the word break points in <var>s</var>, an array of <var>n</var> units, and
91 stores the result at <code><var>p</var>[0..<var>n</var>-1]</code>.
92 </p><dl compact="compact">
93 <dt> <code><var>p</var>[i] = 1</code></dt>
94 <dd><p>means that there is a word boundary between <code><var>s</var>[i-1]</code> and
95 <code><var>s</var>[i]</code>.
96 </p></dd>
97 <dt> <code><var>p</var>[i] = 0</code></dt>
98 <dd><p>means that <code><var>s</var>[i-1]</code> and <code><var>s</var>[i]</code> must not be separated.
99 </p></dd>
100 </dl>
101 <p><code><var>p</var>[0]</code> is always set to 0.  If an application wants to consider a
102 word break to be present at the beginning of the string (before
103 <code><var>s</var>[0]</code>) or at the end of the string (after
104 <code><var>s</var>[0..<var>n</var>-1]</code>), it has to treat these cases explicitly.
105 </p></dd></dl>
106
107 <hr size="6">
108 <a name="Word-break-property"></a>
109 <a name="SEC40"></a>
110 <h2 class="section"> <a href="libunistring.html#TOC40">10.2 Word break property</a> </h2>
111
112 <p>This is a more low-level API.  The word break property is a property defined
113 in Unicode Standard Annex #29, section &ldquo;Word Boundaries&rdquo;, see
114 <a href="http://www.unicode.org/reports/tr29/#Word_Boundaries">http://www.unicode.org/reports/tr29/#Word_Boundaries</a>.  It is
115 used for determining the word breaks in a string.
116 </p>
117 <p>The following are the possible values of the word break property.  More values
118 may be added in the future.
119 </p>
120 <dl>
121 <dt><u>Constant:</u> int <b>WBP_OTHER</b>
122 <a name="IDX619"></a>
123 </dt>
124 <dt><u>Constant:</u> int <b>WBP_CR</b>
125 <a name="IDX620"></a>
126 </dt>
127 <dt><u>Constant:</u> int <b>WBP_LF</b>
128 <a name="IDX621"></a>
129 </dt>
130 <dt><u>Constant:</u> int <b>WBP_NEWLINE</b>
131 <a name="IDX622"></a>
132 </dt>
133 <dt><u>Constant:</u> int <b>WBP_EXTEND</b>
134 <a name="IDX623"></a>
135 </dt>
136 <dt><u>Constant:</u> int <b>WBP_FORMAT</b>
137 <a name="IDX624"></a>
138 </dt>
139 <dt><u>Constant:</u> int <b>WBP_KATAKANA</b>
140 <a name="IDX625"></a>
141 </dt>
142 <dt><u>Constant:</u> int <b>WBP_ALETTER</b>
143 <a name="IDX626"></a>
144 </dt>
145 <dt><u>Constant:</u> int <b>WBP_MIDNUMLET</b>
146 <a name="IDX627"></a>
147 </dt>
148 <dt><u>Constant:</u> int <b>WBP_MIDLETTER</b>
149 <a name="IDX628"></a>
150 </dt>
151 <dt><u>Constant:</u> int <b>WBP_MIDNUM</b>
152 <a name="IDX629"></a>
153 </dt>
154 <dt><u>Constant:</u> int <b>WBP_NUMERIC</b>
155 <a name="IDX630"></a>
156 </dt>
157 <dt><u>Constant:</u> int <b>WBP_EXTENDNUMLET</b>
158 <a name="IDX631"></a>
159 </dt>
160 </dl>
161
162 <p>The following function looks up the word break property of a character.
163 </p>
164 <dl>
165 <dt><u>Function:</u> int <b>uc_wordbreak_property</b><i> (ucs4_t <var>uc</var>)</i>
166 <a name="IDX632"></a>
167 </dt>
168 <dd><p>Returns the Word_Break property of a Unicode character.
169 </p></dd></dl>
170 <hr size="6">
171 <table cellpadding="1" cellspacing="1" border="0">
172 <tr><td valign="middle" align="left">[<a href="#SEC38" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
173 <td valign="middle" align="left">[<a href="libunistring_11.html#SEC41" title="Next chapter"> &gt;&gt; </a>]</td>
174 <td valign="middle" align="left"> &nbsp; </td>
175 <td valign="middle" align="left"> &nbsp; </td>
176 <td valign="middle" align="left"> &nbsp; </td>
177 <td valign="middle" align="left"> &nbsp; </td>
178 <td valign="middle" align="left"> &nbsp; </td>
179 <td valign="middle" align="left">[<a href="libunistring.html#SEC_Top" title="Cover (top) of document">Top</a>]</td>
180 <td valign="middle" align="left">[<a href="libunistring.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
181 <td valign="middle" align="left">[<a href="libunistring_18.html#SEC71" title="Index">Index</a>]</td>
182 <td valign="middle" align="left">[<a href="libunistring_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
183 </tr></table>
184 <p>
185  <font size="-1">
186   This document was generated by <em>Bruno Haible</em> on <em>March, 30 2010</em> using <a href="http://www.nongnu.org/texi2html/"><em>texi2html 1.78a</em></a>.
187  </font>
188  <br>
189
190 </p>
191 </body>
192 </html>