breakiterator

BreakIterator not working correctly with Chinese text

筅森魡賤 提交于 2019-12-23 20:14:44
问题 I used BreakIterator.getWordInstance to split a Chinese text into words. Here is my example import java.text.BreakIterator; import java.util.Locale; public class Sample { public static void main(String[] args) { String stringToExamine = "I like to eat apples. 我喜欢吃苹果。"; //print each word in order BreakIterator boundary = BreakIterator.getWordInstance(new Locale("zh", "CN")); boundary.setText(stringToExamine); printEachForward(boundary, stringToExamine); } public static void printEachForward

How does BreakIterator work in Android?

只谈情不闲聊 提交于 2019-11-27 05:21:31
I'm making my own text processor in Android (a custom vertical script TextView for Mongolian). I thought I would have to find all the line breaking locations myself so that I could implement line wrapping, but then I discovered BreakIterator . This seems to find all the possible breaks between characters, words, lines, and sentences in various languages. I'm trying to learn how to use it. The documentation was more helpful than average, but it was still difficult to understand from just reading. I also found a few tutorials (see here , here , and here ) but they lacked the full explanation

How does BreakIterator work in Android?

爱⌒轻易说出口 提交于 2019-11-26 11:32:11
问题 I\'m making my own text processor in Android (a custom vertical script TextView for Mongolian). I thought I would have to find all the line breaking locations myself so that I could implement line wrapping, but then I discovered BreakIterator. This seems to find all the possible breaks between characters, words, lines, and sentences in various languages. I\'m trying to learn how to use it. The documentation was more helpful than average, but it was still difficult to understand from just