//-------------------------------------------------------------- public WordTable firstScan(WordChain wChain, WordTable wTable) { // 速度向上のため、skipさせる if (wTable.IsTransSkipWord()) { return(wTable); // 何もせずreturn } // 前処理 wTable = ChainPreProc(wChain, wTable); // 数助詞,冠数詞をチェック wTable = Numerative.Scan(wChain, wTable); // 助詞の解析を試す (前の語の辞書引きあり) wTable = KJ_pp.Scan(wChain, wTable); //2005.08.26 数詞の前に return(wTable); }
//------------------------------------------------------------------ private WordChain WordDivider(WordTable wTable) { WordChain wc1 = null; #if DEBUG_LOG KJ_Analyzer.WriteDebugLog("WordDivider"); #endif // 辞書検索なしの助詞チェック if (KJ_dict.inputIsHangul) { wc1 = KJ_pp.CheckPPwithoutDictKr(wTable); } // 3文字の「ハングルまたは漢字」なら特別チェック if (wTable.word.Length == 3 && (CodeCheck.IsHangul(wTable.word) || CodeCheck.IsKanji(wTable.word)) ) { WordChain wcThree = Check3Chars(wTable); if (wcThree != null) { return(wcThree); } } // 全体でmatchしないなら部分文字列で検索(再起 語分解あり) WordChain wc2 = null; wc2 = WordPartProc(wTable); // wtは最後の語テーブル。未変換なら再調査 // WordChain wc3 = CheckLastWord(wChain, wTable); // costが小さい方を採用 WordChain rtnWc = WordChain.GetMinimunCostChain(wc1, wc2); return(rtnWc); }
//------------------------------------------------------------------- // private WordTable ScanDetailJp(WordChain wChain, WordTable wTable) { // 助詞を処理 // (助詞で始まる熟語があるので熟語の後) if (wTable.posCategory == PosCategory.PP) { // 改めて訳語を設定 string pp = KJ_pp.TransJapanesePP(wTable); if (pp != "") { // 訳語設定 wTable.transWord = pp; wTable.Cost = 0; // ハングルの助詞なら、分かち書きのため空白を置く。 wTable.transWord = wTable.transWord + " "; return(wTable); } } return(null); }