title: Word Segmentation using ICU
body: <p>I am using ICU4C to transliterate CJK. I am wondering whether it is possible to have word segmentation in ICU, to split Chinese text into a sequence of words, defined according to some word segmentation standard.</p>
  
  <p>When I try transliterating for example: </p>
  
  <pre><code>直接输出html代码而不是作为函数返回值代后处理
  </code></pre>
  
  <p>using </p>
  
  <pre><code>Transliterator* myTrans = 
                    Transliterator::createInstance("zh-Latin",UTRANS_FORWARD, err);
  UnicodeString str;
  str.setTo("直接输出html代码而不是作为函数返回值代后处理");
  myTrans-&gt;transliterate(str);
  str.toUTF8String(st);
  std::cout &lt;&lt; st &lt;&lt; std::endl;
  </code></pre>
  
  <p>I get the following output:</p>
  
  <pre><code>zhí jiē shū chū html dài mǎ ér bù shì zuò wèi hán shù fǎn huí zhí dài hòu chù lǐ
  </code></pre>
  
  <p>It seems perfectly fine checking against online pinyin tools, but my problem is ICU's transliteration the characters one by one. What I'm looking for, though, is something more like the text below (I don't know any Chinese, so probably the text below doesn't mean anything, but it should demonstrate what kind of output I'm interested in):</p>
  
  <pre><code>zhíjiē shūchū html dàimǎér bùshì zuò wèihán shùfǎn huízhídài hòu chùlǐ
  </code></pre>
  
  <p><a href="https://stackoverflow.com/questions/13455282/transliterate-cjk-to-latin-preferably-in-c">I have been told</a> that ICU 50 is capable of word segmentation, but I couldn't find any document in their web page neither on web. Wanted to know if any of you guys have worked with word segmentation in ICU or know how to do it, or if you have any good link on how to do so.</p>