private void OnRefreshWords(object sender, EventArgs e) { _comboBoxSearchValue.DataSource = null; StringCollection indexDirs = GetIndexDirectories(_textBoxSearchIndexPath.Text, true); if (indexDirs == null) { return; } string searchWord = _comboBoxSearchValue.Text; if (string.IsNullOrEmpty(searchWord)) { searchWord = "a"; } List <string> words = new List <string>(); using (WordListBuilder wordsBuilder = new WordListBuilder()) { Dictionary <string, int> wordsMap = new Dictionary <string, int>(); foreach (string dir in indexDirs) { if (wordsBuilder.OpenIndex(dir)) { wordsBuilder.ListWords(searchWord, 5); for (int i = 0; i < wordsBuilder.Count; ++i) { wordsMap[wordsBuilder.GetNthWord(i)] = 1; } } } foreach (KeyValuePair <string, int> kv in wordsMap) { words.Add(kv.Key); } } _comboBoxSearchValue.DataSource = words; }
public void MakeFromWordListBuilder(WordListBuilder wordListBuilder, int iItem) { Word = wordListBuilder.GetNthWord(iItem); HitCount = wordListBuilder.GetNthWordCount(iItem); Detail = " " + wordListBuilder.GetNthWordCount(iItem) + " hits in " + wordListBuilder.GetNthWordDocCount(iItem) + " documents"; }