public void TBLLoad(string fullfilename, SystemTextEncoderTBLEncode inner) { this.FE6Inner = inner; using (StreamReader reader = File.OpenText(fullfilename)) { string line; while ((line = reader.ReadLine()) != null) { if (U.IsComment(line)) { continue; } string[] sp = line.Split('\t'); int count = (sp.Length / 2) * 2; for (int i = 0; i < count; i += 2) { DicC d = new DicC(); d.English = U.Reverse(sp[i + 0]); d.Arabian = sp[i + 1]; d.ArabianIsolated = sp[1]; if (!CheckAlready(d)) { Dic.Add(d); } } } } Dic.Sort((a, b) => { return((int)(b.English.Length - a.English.Length)); }); }
//既に辞書にあるかどうか bool CheckAlready(DicC newD) { foreach (DicC d in this.Dic) { if (d.Arabian == newD.Arabian && d.English == newD.English) { return(true); } } return(false); }