private void ReadCurrentPageConcordance(StreamReader file) { StringBuilder currentPage = new StringBuilder(); for (int i = 0; i < LinesInPage; i++) { currentPage.Append(file.ReadLine() + " "); if (file.EndOfStream) { break; } } PageConcordance.Clear(); foreach (Match m in new Regex(@"\w+").Matches(currentPage.ToString())) { PageConcordance.Add(new Element() { Word = m.Value.ToLower(), ThePageFrequency = 1 }); } if (PageConcordance.Count > 0) { PageNum++; UnitePageConcordanceDuplicates(); SortPageConcordance(); } }
private void ReadCurrentPageConcordance(StreamReader file) { StringBuilder currentPage = new StringBuilder(); for (int i = 0; i < LinesInPage; i++) { currentPage.Append(file.ReadLine() + " "); if (file.EndOfStream) { break; } } PageConcordance.Clear(); foreach (Word w in new Sentence(currentPage.ToString()).Words) { if (!w.ToStringWithoutPunctuators().Equals("")) { PageConcordance.Add(new Element() { Word = w.ToStringWithoutPunctuators().ToLower(), ThePageFrequency = 1 }); } } if (PageConcordance.Count > 0) { PageNum++; UnitePageConcordanceDuplicates(); SortPageConcordance(); } }