1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html401/loose.dtd">
3 <!-- Created on September, 1 2014 by texi2html 1.78a -->
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>
9 Maintained by: Many creative people.
10 Send bugs and suggestions to <texi2html-bug@nongnu.org>
14 <title>GNU libunistring: 11. Word breaks in strings <uniwbrk.h></title>
16 <meta name="description" content="GNU libunistring: 11. Word breaks in strings <uniwbrk.h>">
17 <meta name="keywords" content="GNU libunistring: 11. Word breaks in strings <uniwbrk.h>">
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">
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}
42 <body lang="en" bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#800080" alink="#FF0000">
44 <table cellpadding="1" cellspacing="1" border="0">
45 <tr><td valign="middle" align="left">[<a href="libunistring_10.html#SEC41" title="Beginning of this chapter or previous chapter"> << </a>]</td>
46 <td valign="middle" align="left">[<a href="libunistring_12.html#SEC47" title="Next chapter"> >> </a>]</td>
47 <td valign="middle" align="left"> </td>
48 <td valign="middle" align="left"> </td>
49 <td valign="middle" align="left"> </td>
50 <td valign="middle" align="left"> </td>
51 <td valign="middle" align="left"> </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_19.html#SEC77" title="Index">Index</a>]</td>
55 <td valign="middle" align="left">[<a href="libunistring_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
59 <a name="uniwbrk_002eh"></a>
61 <h1 class="chapter"> <a href="libunistring.html#TOC44">11. Word breaks in strings <code><uniwbrk.h></code></a> </h1>
63 <p>This include file declares functions for determining where in a string
64 “words” start and end. Here “words” 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
71 <a name="Word-breaks-in-a-string"></a>
73 <h2 class="section"> <a href="libunistring.html#TOC45">11.1 Word breaks in a string</a> </h2>
75 <p>The following functions determine the word breaks in a string.
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>
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>
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>
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>
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>.
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.
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.
108 <a name="Word-break-property"></a>
110 <h2 class="section"> <a href="libunistring.html#TOC46">11.2 Word break property</a> </h2>
112 <p>This is a more low-level API. The word break property is a property defined
113 in Unicode Standard Annex #29, section “Word Boundaries”, 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.
117 <p>The following are the possible values of the word break property. More values
118 may be added in the future.
121 <dt><u>Constant:</u> int <b>WBP_OTHER</b>
122 <a name="IDX740"></a>
124 <dt><u>Constant:</u> int <b>WBP_CR</b>
125 <a name="IDX741"></a>
127 <dt><u>Constant:</u> int <b>WBP_LF</b>
128 <a name="IDX742"></a>
130 <dt><u>Constant:</u> int <b>WBP_NEWLINE</b>
131 <a name="IDX743"></a>
133 <dt><u>Constant:</u> int <b>WBP_EXTEND</b>
134 <a name="IDX744"></a>
136 <dt><u>Constant:</u> int <b>WBP_FORMAT</b>
137 <a name="IDX745"></a>
139 <dt><u>Constant:</u> int <b>WBP_KATAKANA</b>
140 <a name="IDX746"></a>
142 <dt><u>Constant:</u> int <b>WBP_ALETTER</b>
143 <a name="IDX747"></a>
145 <dt><u>Constant:</u> int <b>WBP_MIDNUMLET</b>
146 <a name="IDX748"></a>
148 <dt><u>Constant:</u> int <b>WBP_MIDLETTER</b>
149 <a name="IDX749"></a>
151 <dt><u>Constant:</u> int <b>WBP_MIDNUM</b>
152 <a name="IDX750"></a>
154 <dt><u>Constant:</u> int <b>WBP_NUMERIC</b>
155 <a name="IDX751"></a>
157 <dt><u>Constant:</u> int <b>WBP_EXTENDNUMLET</b>
158 <a name="IDX752"></a>
162 <p>The following function looks up the word break property of a character.
165 <dt><u>Function:</u> int <b>uc_wordbreak_property</b><i> (ucs4_t <var>uc</var>)</i>
166 <a name="IDX753"></a>
168 <dd><p>Returns the Word_Break property of a Unicode character.
171 <table cellpadding="1" cellspacing="1" border="0">
172 <tr><td valign="middle" align="left">[<a href="#SEC44" title="Beginning of this chapter or previous chapter"> << </a>]</td>
173 <td valign="middle" align="left">[<a href="libunistring_12.html#SEC47" title="Next chapter"> >> </a>]</td>
174 <td valign="middle" align="left"> </td>
175 <td valign="middle" align="left"> </td>
176 <td valign="middle" align="left"> </td>
177 <td valign="middle" align="left"> </td>
178 <td valign="middle" align="left"> </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_19.html#SEC77" title="Index">Index</a>]</td>
182 <td valign="middle" align="left">[<a href="libunistring_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
186 This document was generated by <em>Daiki Ueno</em> on <em>September, 1 2014</em> using <a href="http://www.nongnu.org/texi2html/"><em>texi2html 1.78a</em></a>.