Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1)

Unified Diff: icu46/source/common/brkeng.cpp

Issue 6370014: CJK segmentation patch for ICU 4.6... (Closed) Base URL: svn://chrome-svn/chrome/trunk/deps/third_party/
Patch Set: Created 9 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « icu46/patches/segmentation.patch ('k') | icu46/source/common/dictbe.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: icu46/source/common/brkeng.cpp
===================================================================
--- icu46/source/common/brkeng.cpp (revision 68397)
+++ icu46/source/common/brkeng.cpp (working copy)
@@ -226,6 +226,30 @@
case USCRIPT_THAI:
engine = new ThaiBreakEngine(dict, status);
break;
+
+ case USCRIPT_HANGUL:
+ engine = new CjkBreakEngine(dict, kKorean, status);
+ break;
+
+ // use same BreakEngine and dictionary for both Chinese and Japanese
+ case USCRIPT_HIRAGANA:
+ case USCRIPT_KATAKANA:
+ case USCRIPT_HAN:
+ engine = new CjkBreakEngine(dict, kChineseJapanese, status);
+ break;
+#if 0
+ // TODO: Have to get some characters with script=common handled
+ // by CjkBreakEngine (e.g. U+309B). Simply subjecting
+ // them to CjkBreakEngine does not work. The engine has to
+ // special-case them.
+ case USCRIPT_COMMON:
+ {
+ UBlockCode block = ublock_getCode(code);
+ if (block == UBLOCK_HIRAGANA || block == UBLOCK_KATAKANA)
+ engine = new CjkBreakEngine(dict, kChineseJapanese, status);
+ break;
+ }
+#endif
default:
break;
}
@@ -281,6 +305,13 @@
dict = NULL;
}
return dict;
+ } else if (dictfname != NULL){
+ //create dummy dict if dictionary filename not valid
+ UChar c = 0x0020;
+ status = U_ZERO_ERROR;
+ MutableTrieDictionary *mtd = new MutableTrieDictionary(c, status, TRUE);
+ mtd->addWord(&c, 1, status, 1);
+ return new CompactTrieDictionary(*mtd, status);
}
return NULL;
}
« no previous file with comments | « icu46/patches/segmentation.patch ('k') | icu46/source/common/dictbe.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698