public static void ExportUsedWords() { foreach (var courseLang in crsLangs) { var fn = string.Format(@"d:\LMCom\rew\Web4\RwDicts\UsedWords\CourseWordsFlat_{0}.txt", courseLang); File.WriteAllLines(fn, LingeaDictionary.wordsForCourse(XmlUtils.FileToObject <schools.DictCrsWords>(string.Format(@"d:\LMCom\rew\Web4\RwDicts\UsedWords\CourseWords_{0}.xml", courseLang))).Select(w => w.word.ToLower().Trim()).OrderBy(w => w).Distinct() ); } }
public static void RunStemming() { using (var imp = new Impersonator("pavel", "LANGMaster", "zvahov88_")) RunStemming <List <string> >( crsLangs, lng => LingeaDictionary.wordsForCourse(XmlUtils.FileToObject <schools.DictCrsWords>(string.Format(@"d:\LMCom\rew\Web4\RwDicts\UsedWords\CourseWords_{0}.xml", lng))).Select(w => w.word.ToLower().Trim()).Distinct().ToArray(), lng => new List <string>(), (lng, word, row, res) => res.Add(row.AgregateSB((sb, i) => { sb.Append("|"); sb.Append(i); })), (lng, res) => File.WriteAllLines(string.Format(@"d:\LMCom\rew\Web4\RwDicts\UsedWords\CourseWordsStems_{0}.txt", lng), res), imp ); }