ICU-5426 Compact cached UnicodeSets, and make setCharacters take a const UnicodeSet.

X-SVN-Rev: 20460
This commit is contained in:
George Rhoten 2006-09-30 00:37:45 +00:00
parent 7929f274ba
commit c34f0ecd83
2 changed files with 10 additions and 2 deletions

View file

@ -81,8 +81,10 @@ DictionaryBreakEngine::findBreaks( UText *text,
}
void
DictionaryBreakEngine::setCharacters( UnicodeSet &set ) {
DictionaryBreakEngine::setCharacters( const UnicodeSet &set ) {
fSet = set;
// Compact for caching
fSet.compact();
}
/*void
@ -225,6 +227,12 @@ ThaiBreakEngine::ThaiBreakEngine(const TrieWordDictionary *adoptDictionary, UErr
fBeginWordSet.add(0x0E40, 0x0E44); // SARA E through SARA AI MAIMALAI
fSuffixSet.add(THAI_PAIYANNOI);
fSuffixSet.add(THAI_MAIYAMOK);
// Compact for caching.
fMarkSet.compact();
fEndWordSet.compact();
fBeginWordSet.compact();
fSuffixSet.compact();
}
ThaiBreakEngine::~ThaiBreakEngine() {

View file

@ -104,7 +104,7 @@ class DictionaryBreakEngine : public LanguageBreakEngine {
*
* @param set A UnicodeSet of the set of characters handled by the engine
*/
virtual void setCharacters( UnicodeSet &set );
virtual void setCharacters( const UnicodeSet &set );
/**
* <p>Set the break types handled by this engine.</p>