} // end of DisplayResult_edict #endif // //---------------------------------------------------------------------- // // 1つの語のデータを,表示用のstringに整形する。(for RichTextBoxEx) // // // // 結果表示の中からリンククリックによる再検索などを実装する。 // // (作成途中のため,コメント化。[2010/07/19 16:59:17]) // // // private void DisplayResult_Ex(string searchword , DocumentData sd){ // // StringBuilder rtn_str = new StringBuilder(); // rtn_str.Length = 0; // // string key_from=""; // 検索語 // string key_to=""; // string word_from = ""; // string word_to = ""; // string detail=""; // string ex=""; // string cost=""; // string src=""; // string pos=""; // 品詞情報、格変化 (暫定) // // String indent = ""; // // // 入力がハングルならfromがkey1(ハングル) // // 入力が漢字・ひらがな・カタカナならfromがkey2(日本語) // // // // 入力が数字・英語の場合は,OSに依存。 // // ・OSが"ja-JP"ならfromがkey1(ハングル) // // ・OSが"ja-JP"以外ならfromがkey2(日本語) // if(this.inputIsHangul){ // key_from = sd.GetData("key1"); // key_to = sd.GetData("key2"); // word_from = sd.GetData("word1"); // word_to = sd.GetData("word2"); // ex = sd.GetData("ex1"); // cost = sd.GetData("cost2"); // }else{ // key_from = sd.GetData("key2"); // Jp // key_to = sd.GetData("key1"); // Kr // word_from = sd.GetData("word2"); // word_to = sd.GetData("word1"); // ex = sd.GetData("ex2"); // cost = sd.GetData("cost1"); // } // // // // 表示の見た目を整える。インデントつけたり、括弧をつけたり。 // // // 入力語の表示 // // this.AddLink(key_from); // if(word_from != ""){ // // 詳細情報は以下の場合だけ // // ・韓国OSのとき // // または // // ・デバッグ情報表示時 // if(this.cultureName == "ko-KR" || // CodeCheck.IsKanji(word_from) || // Setting.debugInfo ) { // // 詳細情報。ハングルの旧漢字、日本語の読み // this.AddText(" 〔 " + word_from + " 〕" ); // } // } // this.AddText("\n"); // // // // K-->Jの時の入力ハングルのカナ表記の表示 // if(this.Setting.withPronunciation) { // if(this.inputIsHangul){ // if(this.Setting.PronunciationType == 1){ // string kana = Hangul.Hangul2Kana(key_from); // this.AddText(" (" + kana + ")\n" ); // }else{ // this.AddText(indent + " (" + // sd.GetData("pronun1") + ")\n" ); // } // } // } // // // // もしあれば品詞情報 // pos = MakePosString(sd); // if(pos != null && pos != ""){ // this.AddText(indent + "【 " + pos + " 】\n"); // } // // // 結果の表示 // this.AddText(indent + key_to ); // // // // 詳細情報は以下の場合だけ // // ・韓国OSのとき // // または // // ・デバッグ情報表示時 // if(word_to != ""){ // if(this.cultureName == "ko-KR" || // CodeCheck.IsKanji(word_to) || // Setting.debugInfo ){ // this.AddText(" 〔 " + word_to + " 〕" ); // // 詳細情報。ハングルの旧漢字、日本語の読み // } // } // this.AddText("\n"); // // // J-->Kの時の結果ハングルのカナ表記の表示 // if(this.Setting.withPronunciation) { // // 表示の設定がされているときだけ // if(!this.inputIsHangul){ // if(this.Setting.PronunciationType == 1){ // string kana = Hangul.Hangul2Kana(key_to); // this.AddText(indent + " (" + kana + ")\n" ); // }else{ // this.AddText(indent + " (" + // sd.GetData("pronun1") + ")\n" ); // } // } // } // // // その他付加情報 // detail = MakeDetailString(sd); // if(detail != null && detail != ""){ // this.AddText(indent + "( " + detail + " )\n"); // } // if(ex != ""){ // this.AddText(indent + "Ex. "+ ex + "\n"); // } // // // // 「デバッグ情報表示」 を選んだ場合 // if(Setting.debugInfo){ // src = sd.GetData("src"); // if(src != ""){ // this.AddText(indent + "src:" + src + "\n"); // } // if(cost != ""){ // this.AddText(indent + "cost:" + cost + "\n"); // } // string pos2=sd.GetPos(); // posの生データ // if(pos2 != ""){ // this.AddText(indent + "pos:" + pos2 + "\n"); // } // } // // this.AddText("\n"); // // prev_keyword = key_from; // 記憶 // // return ; // } // //------------------------------------------------------------------ // KJ_form デフォルトのフィルタ costにより表示しない public bool defaultFilter(DocumentData doc) { if (this.Setting.except8888 && doc.GetCost(this.inputIsHangul) == "8888") { return(false); } if (this.Setting.except9999 && doc.GetCost(this.inputIsHangul) == "9999") { return(false); } // 7777は無条件に非表示 if (doc.GetCost(this.inputIsHangul) == "7777") { return(false); } return(true); }
//--------------------------------------------------------- // まだ使ってない public static bool Valid(DocumentData doc) { string key = doc.GetKey(KJ_dict.inputIsHangul); // 訳語に ~および ... を含むものは自動翻訳では使わない。 // (主に助詞を弾く) if (key.StartsWith("~") || key.EndsWith("~") || key.StartsWith("...") || key.EndsWith("...")) { return(false); } string costString = doc.GetCost(KJ_dict.inputIsHangul); // cost 9999は、無条件に使わない if (costString == "9999") { return(false); } return(true); }