private bool IsEntryCorrect(IWordCoOccurrenceMatrix matrix, IMatrixEntry entry, char start, string[] words) { var otherWord = words.Contains(entry.Column) ? entry.Row : entry.Column; if (words.Contains(otherWord) || !otherWord.StartsWith(start.ToString())) { return(false); } return(words.All(w => matrix.GetCoOccurrenceCount(w, otherWord) > 0)); }
private bool IsEntryStartWith(IMatrixEntry entry, char c1, char c2) { return(entry.Column.StartsWith(c1.ToString()) && entry.Row.StartsWith(c2.ToString()) ? true : entry.Column.StartsWith(c2.ToString()) && entry.Row.StartsWith(c1.ToString())); }