static void InitAllDics() { // if (s_dicInit || s_dicProvider == null) { return; } if (s_thaiDic == null) { var customDic = new CustomDic(); customDic.SetCharRange(ThaiDictionaryBreakingEngine.FirstChar, ThaiDictionaryBreakingEngine.LastChar); customDic.LoadSortedUniqueWordList(s_dicProvider.GetSortedUniqueWordList("thai")); s_thaiDic = customDic; } if (s_laoDic == null) { var customDic = new CustomDic(); customDic.SetCharRange(LaoDictionaryBreakingEngine.FirstChar, LaoDictionaryBreakingEngine.LastChar); customDic.LoadSortedUniqueWordList(s_dicProvider.GetSortedUniqueWordList("lao")); s_laoDic = customDic; } if (s_enAbbrvDic == null) { s_enAbbrvDic = new CustomAbbrvDic(); s_enAbbrvDic.LoadSortedUniqueWordList(s_dicProvider.GetSortedUniqueWordList("abbrv-en")); } s_dicInit = true; }
static void InitAllDics() { if (thaiDicBreakingEngine == null) { var customDic = new CustomDic(); thaiDicBreakingEngine = new ThaiDictionaryBreakingEngine(); thaiDicBreakingEngine.SetDictionaryData(customDic);//add customdic to the breaker customDic.SetCharRange(thaiDicBreakingEngine.FirstUnicodeChar, thaiDicBreakingEngine.LastUnicodeChar); using (Stream data = s_dataProvider.GetDataStream("thaidict.txt")) { customDic.LoadFromDataStream(data); } } if (laoDicBreakingEngine == null) { var customDic = new CustomDic(); laoDicBreakingEngine = new LaoDictionaryBreakingEngine(); laoDicBreakingEngine.SetDictionaryData(customDic);//add customdic to the breaker customDic.SetCharRange(laoDicBreakingEngine.FirstUnicodeChar, laoDicBreakingEngine.LastUnicodeChar); using (Stream data = s_dataProvider.GetDataStream("laodict.txt")) { customDic.LoadFromDataStream(data); } } }
static void InitAllDics() { if (thaiDicBreakingEngine == null) { var customDic = new CustomDic(); thaiDicBreakingEngine = new ThaiDictionaryBreakingEngine(); thaiDicBreakingEngine.SetDictionaryData(customDic);//add customdic to the breaker customDic.SetCharRange(thaiDicBreakingEngine.FirstUnicodeChar, thaiDicBreakingEngine.LastUnicodeChar); customDic.LoadSortedUniqueWordList(s_dicProvider.GetSortedUniqueWordList("thai")); } if (laoDicBreakingEngine == null) { var customDic = new CustomDic(); laoDicBreakingEngine = new LaoDictionaryBreakingEngine(); laoDicBreakingEngine.SetDictionaryData(customDic);//add customdic to the breaker customDic.SetCharRange(laoDicBreakingEngine.FirstUnicodeChar, laoDicBreakingEngine.LastUnicodeChar); customDic.LoadSortedUniqueWordList(s_dicProvider.GetSortedUniqueWordList("lao")); } }