Difference between revisions of "LoadICUBreakIterator"
(tab) |
(add rulestring) |
||
Line 11: | Line 11: | ||
=Use cases of <code>loadICUBreakIterator</code>= | =Use cases of <code>loadICUBreakIterator</code>= | ||
+ | |||
+ | Questions: | ||
+ | *Why does <code>wordRule</code> need to be static and preserved across the calls? | ||
+ | *Is rulestring <code>word</code> used at all? Other WordTypes? | ||
{|class="wikitable" | {|class="wikitable" | ||
+ | !public method | ||
+ | !loadICU call | ||
+ | !resulting rule text | ||
+ | |- | ||
| | | | ||
nextCharacters(Text, nStartPos, rLocale, | nextCharacters(Text, nStartPos, rLocale, | ||
Line 20: | Line 28: | ||
SKIPCELL, sal_Int32 nCount, nDone) | SKIPCELL, sal_Int32 nCount, nDone) | ||
|loadICUBreakIterator(rLocale, LOAD_CHARACTER_BREAKITERATOR, 0, "char", Text) | |loadICUBreakIterator(rLocale, LOAD_CHARACTER_BREAKITERATOR, 0, "char", Text) | ||
+ | |<code>char</code> | ||
|- | |- | ||
| | | | ||
Line 31: | Line 40: | ||
rLocale, ANYWORD_IGNOREWHITESPACES, sal_Bool bDirection) | rLocale, ANYWORD_IGNOREWHITESPACES, sal_Bool bDirection) | ||
|loadICUBreakIterator(rLocale, LOAD_WORD_BREAKITERATOR, ANYWORD_IGNOREWHITESPACES, NULL, Text) | |loadICUBreakIterator(rLocale, LOAD_WORD_BREAKITERATOR, ANYWORD_IGNOREWHITESPACES, NULL, Text) | ||
+ | |<code>edit_word</code> | ||
|- | |- | ||
| | | | ||
Line 42: | Line 52: | ||
rLocale, DICTIONARY_WORD, sal_Bool bDirection) | rLocale, DICTIONARY_WORD, sal_Bool bDirection) | ||
|loadICUBreakIterator(rLocale, LOAD_WORD_BREAKITERATOR, DICTIONARY_WORD, NULL, Text) | |loadICUBreakIterator(rLocale, LOAD_WORD_BREAKITERATOR, DICTIONARY_WORD, NULL, Text) | ||
+ | |<code>dict_word</code> | ||
|- | |- | ||
| | | | ||
Line 53: | Line 64: | ||
rLocale, WORD_COUNT, sal_Bool bDirection) | rLocale, WORD_COUNT, sal_Bool bDirection) | ||
|loadICUBreakIterator(rLocale, LOAD_WORD_BREAKITERATOR, WORD_COUNT, NULL, Text) | |loadICUBreakIterator(rLocale, LOAD_WORD_BREAKITERATOR, WORD_COUNT, NULL, Text) | ||
+ | |<code>count_word</code> | ||
+ | |- | ||
+ | | | ||
+ | nextWord( const OUString& Text, sal_Int32 nStartPos, | ||
+ | rLocale, another_word_type) | ||
+ | |||
+ | previousWord(const OUString& Text, sal_Int32 nStartPos, | ||
+ | rLocale, another_word_type) | ||
+ | |||
+ | getWordBoundary( const OUString& Text, sal_Int32 nPos, | ||
+ | rLocale, another_word_type, sal_Bool bDirection) | ||
+ | |loadICUBreakIterator(rLocale, LOAD_WORD_BREAKITERATOR, WORD_COUNT, NULL, Text) | ||
+ | |<code>word</code> '''(???)''' | ||
|- | |- | ||
| | | | ||
Line 59: | Line 83: | ||
endOfSentence( const OUString& Text, sal_Int32 nStartPos,rLocale) | endOfSentence( const OUString& Text, sal_Int32 nStartPos,rLocale) | ||
|loadICUBreakIterator(rLocale, LOAD_SENTENCE_BREAKITERATOR, 0, NULL, Text); | |loadICUBreakIterator(rLocale, LOAD_SENTENCE_BREAKITERATOR, 0, NULL, Text); | ||
+ | |NULL | ||
|- | |- | ||
| | | | ||
Line 67: | Line 92: | ||
const LineBreakUserOptions& /*rOptions*/ ) | const LineBreakUserOptions& /*rOptions*/ ) | ||
|loadICUBreakIterator(rLocale, LOAD_LINE_BREAKITERATOR, 0, "line", Text); | |loadICUBreakIterator(rLocale, LOAD_LINE_BREAKITERATOR, 0, "line", Text); | ||
+ | |<code>line</code> | ||
|} | |} | ||
+ | |||
+ | # Figure out if locale BreakIteratorRules (<code>{edit_word, dict_word, count_word, char, line}</code>) gives something for the requested locale | ||
+ | # If not, try to load ''rule''+<code>_</code> + ''lang'' string anyway. |
Revision as of 00:26, 1 May 2008
Breaking encapsulation of ICU BreakIterator
Because of Issue 84467 , we are using RuleBasedBreakIterator() constructor
and then we want to setBreakType()
there.
ICU code:
- BreakIterator reference
- RuleBasedBreakIterator reference
OpenOffice.org code:
Use cases of loadICUBreakIterator
Questions:
- Why does
wordRule
need to be static and preserved across the calls? - Is rulestring
word
used at all? Other WordTypes?
public method | loadICU call | resulting rule text |
---|---|---|
nextCharacters(Text, nStartPos, rLocale, SKIPCELL, sal_Int32 nCount, nDone) prevCharacters(Text, nStartPos, rLocale, SKIPCELL, sal_Int32 nCount, nDone) |
loadICUBreakIterator(rLocale, LOAD_CHARACTER_BREAKITERATOR, 0, "char", Text) | char
|
nextWord( const OUString& Text, sal_Int32 nStartPos, rLocale, ANYWORD_IGNOREWHITESPACES) previousWord(const OUString& Text, sal_Int32 nStartPos, rLocale, ANYWORD_IGNOREWHITESPACES) getWordBoundary( const OUString& Text, sal_Int32 nPos, rLocale, ANYWORD_IGNOREWHITESPACES, sal_Bool bDirection) |
loadICUBreakIterator(rLocale, LOAD_WORD_BREAKITERATOR, ANYWORD_IGNOREWHITESPACES, NULL, Text) | edit_word
|
nextWord( const OUString& Text, sal_Int32 nStartPos, rLocale, DICTIONARY_WORD) previousWord(const OUString& Text, sal_Int32 nStartPos, rLocale, DICTIONARY_WORD) getWordBoundary( const OUString& Text, sal_Int32 nPos, rLocale, DICTIONARY_WORD, sal_Bool bDirection) |
loadICUBreakIterator(rLocale, LOAD_WORD_BREAKITERATOR, DICTIONARY_WORD, NULL, Text) | dict_word
|
nextWord( const OUString& Text, sal_Int32 nStartPos, rLocale, WORD_COUNT) previousWord(const OUString& Text, sal_Int32 nStartPos, rLocale, WORD_COUNT) getWordBoundary( const OUString& Text, sal_Int32 nPos, rLocale, WORD_COUNT, sal_Bool bDirection) |
loadICUBreakIterator(rLocale, LOAD_WORD_BREAKITERATOR, WORD_COUNT, NULL, Text) | count_word
|
nextWord( const OUString& Text, sal_Int32 nStartPos, rLocale, another_word_type) previousWord(const OUString& Text, sal_Int32 nStartPos, rLocale, another_word_type) getWordBoundary( const OUString& Text, sal_Int32 nPos, rLocale, another_word_type, sal_Bool bDirection) |
loadICUBreakIterator(rLocale, LOAD_WORD_BREAKITERATOR, WORD_COUNT, NULL, Text) | word (???)
|
beginOfSentence( const OUString& Text, sal_Int32 nStartPos, rLocale) endOfSentence( const OUString& Text, sal_Int32 nStartPos,rLocale) |
loadICUBreakIterator(rLocale, LOAD_SENTENCE_BREAKITERATOR, 0, NULL, Text); | NULL |
getLineBreak( const OUString& Text, sal_Int32 nStartPos, const lang::Locale& rLocale, sal_Int32 nMinBreakPos, const LineBreakHyphenationOptions& hOptions, const LineBreakUserOptions& /*rOptions*/ ) |
loadICUBreakIterator(rLocale, LOAD_LINE_BREAKITERATOR, 0, "line", Text); | line
|
- Figure out if locale BreakIteratorRules (
{edit_word, dict_word, count_word, char, line}
) gives something for the requested locale - If not, try to load rule+
_
+ lang string anyway.