private static void SaveMyStemWords() { var vocabulary = new Vocabulary(Program.QuestionsFileName, Program.AnswersFileName); var stemToWord = new Dictionary<string, List<string>>(); foreach (var stemInfo in vocabulary.GetWordInfos()) { if (stemToWord.ContainsKey(stemInfo.Value.Stem)) { stemToWord[stemInfo.Value.Stem].Add(stemInfo.Key); } else { stemToWord.Add(stemInfo.Value.Stem, new List<string>()); } } File.WriteAllText("MyStem.txt", String.Join("\n", stemToWord.Select(kv => String.Join(" ", kv.Value)))); }
public MyStemmer(params string[] fileNames) { vocabulary = new Vocabulary(fileNames); }
public MyStemmer(string uniqueSampleName, IEnumerable<string> words) { File.WriteAllLines(uniqueSampleName, words, Encoding.GetEncoding(1251)); vocabulary = new Vocabulary(uniqueSampleName); }
public Symptoms(Vocabulary vocabulary, IEnumerable<string> mainWords, string neededPartOfSpeech, int radius = 2) { this.vocabulary = vocabulary; this.neededPartOfSpeech = neededPartOfSpeech; this.radius = radius; this.mainWords = new HashSet<string>(mainWords); }