/usr/share/doc/libthai0/html/thbrk_8h.html is in libthai-doc 0.1.26-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.12"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>libthai: thai/thbrk.h File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">libthai
 <span id="projectnumber">0.1.26</span>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.12 -->
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
initMenu('',false,false,'search.php','Search');
});
</script>
<div id="main-nav"></div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="dir_27634488b513a0cc2afc6ccdc5595e06.html">thai</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="summary">
<a href="#func-members">Functions</a> </div>
<div class="headertitle">
<div class="title">thbrk.h File Reference</div> </div>
</div><!--header-->
<div class="contents">
<p>Thai word segmentation.
<a href="#details">More...</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:a5025d40315abede7c1bc6fb792ac95db"><td class="memItemLeft" align="right" valign="top">ThBrk * </td><td class="memItemRight" valign="bottom"><a class="el" href="thbrk_8h.html#a5025d40315abede7c1bc6fb792ac95db">th_brk_new</a> (const char *dictpath)</td></tr>
<tr class="memdesc:a5025d40315abede7c1bc6fb792ac95db"><td class="mdescLeft"> </td><td class="mdescRight">Create a dictionary-based word breaker. <a href="#a5025d40315abede7c1bc6fb792ac95db">More...</a><br /></td></tr>
<tr class="separator:a5025d40315abede7c1bc6fb792ac95db"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a7d0a9fcab72812466336a06bf40e8fde"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="thbrk_8h.html#a7d0a9fcab72812466336a06bf40e8fde">th_brk_delete</a> (ThBrk *brk)</td></tr>
<tr class="memdesc:a7d0a9fcab72812466336a06bf40e8fde"><td class="mdescLeft"> </td><td class="mdescRight">Delete a word breaker. <a href="#a7d0a9fcab72812466336a06bf40e8fde">More...</a><br /></td></tr>
<tr class="separator:a7d0a9fcab72812466336a06bf40e8fde"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ac4fd65b680140d72d91f9c249381a3e7"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="thbrk_8h.html#ac4fd65b680140d72d91f9c249381a3e7">th_brk_find_breaks</a> (ThBrk *brk, const <a class="el" href="thailib_8h.html#a75138f51cef42c2e0d8bc3e6ce691f51">thchar_t</a> *s, int pos[], size_t pos_sz)</td></tr>
<tr class="memdesc:ac4fd65b680140d72d91f9c249381a3e7"><td class="mdescLeft"> </td><td class="mdescRight">Find word break positions in Thai string. <a href="#ac4fd65b680140d72d91f9c249381a3e7">More...</a><br /></td></tr>
<tr class="separator:ac4fd65b680140d72d91f9c249381a3e7"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a4caba8399ab4c894534ab3949f340c9b"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="thbrk_8h.html#a4caba8399ab4c894534ab3949f340c9b">th_brk_insert_breaks</a> (ThBrk *brk, const <a class="el" href="thailib_8h.html#a75138f51cef42c2e0d8bc3e6ce691f51">thchar_t</a> *in, <a class="el" href="thailib_8h.html#a75138f51cef42c2e0d8bc3e6ce691f51">thchar_t</a> *out, size_t out_sz, const char *delim)</td></tr>
<tr class="memdesc:a4caba8399ab4c894534ab3949f340c9b"><td class="mdescLeft"> </td><td class="mdescRight">Insert word delimitors in given string. <a href="#a4caba8399ab4c894534ab3949f340c9b">More...</a><br /></td></tr>
<tr class="separator:a4caba8399ab4c894534ab3949f340c9b"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:af2968cc4572afd30f17f24fec3338b13"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="thbrk_8h.html#af2968cc4572afd30f17f24fec3338b13">th_brk</a> (const <a class="el" href="thailib_8h.html#a75138f51cef42c2e0d8bc3e6ce691f51">thchar_t</a> *s, int pos[], size_t pos_sz)</td></tr>
<tr class="memdesc:af2968cc4572afd30f17f24fec3338b13"><td class="mdescLeft"> </td><td class="mdescRight">Find word break positions in Thai string. <a href="#af2968cc4572afd30f17f24fec3338b13">More...</a><br /></td></tr>
<tr class="separator:af2968cc4572afd30f17f24fec3338b13"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ad6609cb290e2218489bc8d53c209bc10"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="thbrk_8h.html#ad6609cb290e2218489bc8d53c209bc10">th_brk_line</a> (const <a class="el" href="thailib_8h.html#a75138f51cef42c2e0d8bc3e6ce691f51">thchar_t</a> *in, <a class="el" href="thailib_8h.html#a75138f51cef42c2e0d8bc3e6ce691f51">thchar_t</a> *out, size_t out_sz, const char *delim)</td></tr>
<tr class="memdesc:ad6609cb290e2218489bc8d53c209bc10"><td class="mdescLeft"> </td><td class="mdescRight">Insert word delimitors in given string. <a href="#ad6609cb290e2218489bc8d53c209bc10">More...</a><br /></td></tr>
<tr class="separator:ad6609cb290e2218489bc8d53c209bc10"><td class="memSeparator" colspan="2"> </td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>Thai word segmentation. </p>
</div><h2 class="groupheader">Function Documentation</h2>
<a id="af2968cc4572afd30f17f24fec3338b13"></a>
<h2 class="memtitle"><span class="permalink"><a href="#af2968cc4572afd30f17f24fec3338b13">§ </a></span>th_brk()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int th_brk </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="thailib_8h.html#a75138f51cef42c2e0d8bc3e6ce691f51">thchar_t</a> * </td>
<td class="paramname"><em>s</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int </td>
<td class="paramname"><em>pos</em>[], </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">size_t </td>
<td class="paramname"><em>pos_sz</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Find word break positions in Thai string. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">s</td><td>: the input string to be processed </td></tr>
<tr><td class="paramname">pos</td><td>: array to keep breaking positions </td></tr>
<tr><td class="paramname">pos_sz</td><td>: size of <em>pos</em>[]</td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>the actual number of breaking positions occurred</dd></dl>
<p>Finds word break positions in Thai string <em>s</em> and stores at most <em>n</em> breaking positions in <em>pos</em>[], from left to right. Uses the shared word breaker.</p>
<p>(This function is deprecated since version 0.1.25, in favor of <a class="el" href="thbrk_8h.html#ac4fd65b680140d72d91f9c249381a3e7" title="Find word break positions in Thai string. ">th_brk_find_breaks()</a>, which is more thread-safe.) </p>
</div>
</div>
<a id="a7d0a9fcab72812466336a06bf40e8fde"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a7d0a9fcab72812466336a06bf40e8fde">§ </a></span>th_brk_delete()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void th_brk_delete </td>
<td>(</td>
<td class="paramtype">ThBrk * </td>
<td class="paramname"><em>brk</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Delete a word breaker. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">brk</td><td>: the word breaker</td></tr>
</table>
</dd>
</dl>
<p>Frees memory associated with the word breaker.</p>
<p>(Available since version 0.1.25, libthai.so.0.3.0) </p>
</div>
</div>
<a id="ac4fd65b680140d72d91f9c249381a3e7"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ac4fd65b680140d72d91f9c249381a3e7">§ </a></span>th_brk_find_breaks()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int th_brk_find_breaks </td>
<td>(</td>
<td class="paramtype">ThBrk * </td>
<td class="paramname"><em>brk</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const <a class="el" href="thailib_8h.html#a75138f51cef42c2e0d8bc3e6ce691f51">thchar_t</a> * </td>
<td class="paramname"><em>s</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int </td>
<td class="paramname"><em>pos</em>[], </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">size_t </td>
<td class="paramname"><em>pos_sz</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Find word break positions in Thai string. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">brk</td><td>: the word breaker </td></tr>
<tr><td class="paramname">s</td><td>: the input string to be processed </td></tr>
<tr><td class="paramname">pos</td><td>: array to keep breaking positions </td></tr>
<tr><td class="paramname">pos_sz</td><td>: size of <em>pos</em>[]</td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>the actual number of breaking positions occurred</dd></dl>
<p>Finds word break positions in Thai string <em>s</em> and stores at most <em>pos_sz</em> breaking positions in <em>pos</em>[], from left to right.</p>
<p>(Available since version 0.1.25, libthai.so.0.3.0) </p>
</div>
</div>
<a id="a4caba8399ab4c894534ab3949f340c9b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a4caba8399ab4c894534ab3949f340c9b">§ </a></span>th_brk_insert_breaks()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int th_brk_insert_breaks </td>
<td>(</td>
<td class="paramtype">ThBrk * </td>
<td class="paramname"><em>brk</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const <a class="el" href="thailib_8h.html#a75138f51cef42c2e0d8bc3e6ce691f51">thchar_t</a> * </td>
<td class="paramname"><em>in</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="thailib_8h.html#a75138f51cef42c2e0d8bc3e6ce691f51">thchar_t</a> * </td>
<td class="paramname"><em>out</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">size_t </td>
<td class="paramname"><em>out_sz</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const char * </td>
<td class="paramname"><em>delim</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Insert word delimitors in given string. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">brk</td><td>: the word breaker </td></tr>
<tr><td class="paramname">in</td><td>: the input string to be processed </td></tr>
<tr><td class="paramname">out</td><td>: the output buffer </td></tr>
<tr><td class="paramname">out_sz</td><td>: the size of <em>out</em> </td></tr>
<tr><td class="paramname">delim</td><td>: the word delimitor to insert</td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>the actual size of the processed string</dd></dl>
<p>Analyzes the input string and store the string in output buffer with the given word delimitor inserted at every word boundary.</p>
<p>(Available since version 0.1.25, libthai.so.0.3.0) </p>
</div>
</div>
<a id="ad6609cb290e2218489bc8d53c209bc10"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ad6609cb290e2218489bc8d53c209bc10">§ </a></span>th_brk_line()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int th_brk_line </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="thailib_8h.html#a75138f51cef42c2e0d8bc3e6ce691f51">thchar_t</a> * </td>
<td class="paramname"><em>in</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="thailib_8h.html#a75138f51cef42c2e0d8bc3e6ce691f51">thchar_t</a> * </td>
<td class="paramname"><em>out</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">size_t </td>
<td class="paramname"><em>out_sz</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const char * </td>
<td class="paramname"><em>delim</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Insert word delimitors in given string. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">in</td><td>: the input string to be processed </td></tr>
<tr><td class="paramname">out</td><td>: the output buffer </td></tr>
<tr><td class="paramname">out_sz</td><td>: the size of <em>out</em> </td></tr>
<tr><td class="paramname">delim</td><td>: the word delimitor to insert</td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>the actual size of the processed string</dd></dl>
<p>Analyzes the input string and store the string in output buffer with the given word delimitor inserted at every word boundary. Uses the shared word breaker.</p>
<p>(This function is deprecated since version 0.1.25, in favor of <a class="el" href="thbrk_8h.html#a4caba8399ab4c894534ab3949f340c9b" title="Insert word delimitors in given string. ">th_brk_insert_breaks()</a>, which is more thread-safe.) </p>
</div>
</div>
<a id="a5025d40315abede7c1bc6fb792ac95db"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a5025d40315abede7c1bc6fb792ac95db">§ </a></span>th_brk_new()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">ThBrk* th_brk_new </td>
<td>(</td>
<td class="paramtype">const char * </td>
<td class="paramname"><em>dictpath</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Create a dictionary-based word breaker. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">dictpath</td><td>: the dictionary path, or NULL for default</td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>the created instance, or NULL on failure</dd></dl>
<p>Loads the dictionary from the given file and returns the created word breaker. If <em>dictpath</em> is NULL, first searches in the directory given by the LIBTHAI_DICTDIR environment variable, then in the library installation directory. Returns NULL if the dictionary file is not found or cannot be loaded.</p>
<p>The returned ThBrk object should be destroyed after use using <a class="el" href="thbrk_8h.html#a7d0a9fcab72812466336a06bf40e8fde" title="Delete a word breaker. ">th_brk_delete()</a>.</p>
<p>In multi-thread environments, <a class="el" href="thbrk_8h.html#a5025d40315abede7c1bc6fb792ac95db" title="Create a dictionary-based word breaker. ">th_brk_new()</a> and <a class="el" href="thbrk_8h.html#a7d0a9fcab72812466336a06bf40e8fde" title="Delete a word breaker. ">th_brk_delete()</a> should be used to create and destroy a word breaker instance inside critical sections (i.e. with mutex). And the word breaker methods can then be safely called in parallel during its lifetime.</p>
<p>(Available since version 0.1.25, libthai.so.0.3.0) </p>
</div>
</div>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by  <a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.12
</small></address>
</body>
</html>
|