/// ------------------------------------------------------------------------------------ /// <summary> /// /// </summary> /// <param name="tok"></param> /// <param name="wap"></param> /// <param name="desiredKey"></param> /// ------------------------------------------------------------------------------------ public void ProcessWord(ITextToken tok, WordAndPunct wap, string desiredKey) { AWord word = new AWord(wap.Word, m_categorizer); if (word.Prefix == string.Empty && word.Suffix == string.Empty) { return; } if (m_uncapitalizedPrefixes.Contains(word.Prefix)) { return; } if (m_uncapitalizedPrefixes.Contains("*" + word.Prefix[word.Prefix.Length - 1])) { return; } if (m_uncapitalizedPrefixes.Contains("*")) { return; } if (m_capitalizedSuffixes.Contains(word.Suffix)) { return; } if (m_capitalizedPrefixes.Contains(word.Prefix)) { return; } AddWord(tok, wap, desiredKey); }
/// ------------------------------------------------------------------------------------ /// <summary> /// /// </summary> /// <param name="tok"></param> /// <param name="wap"></param> /// <param name="desiredKey"></param> /// ------------------------------------------------------------------------------------ public void ProcessWord(ITextToken tok, WordAndPunct wap, string desiredKey) { AWord word = new AWord(wap.Word, m_categorizer); if (word.Prefix == string.Empty && word.Suffix == string.Empty) return; if (m_uncapitalizedPrefixes.Contains(word.Prefix)) return; if (m_uncapitalizedPrefixes.Contains("*" + word.Prefix[word.Prefix.Length - 1])) return; if (m_uncapitalizedPrefixes.Contains("*")) return; if (m_capitalizedSuffixes.Contains(word.Suffix)) return; if (m_capitalizedPrefixes.Contains(word.Prefix)) return; AddWord(tok, wap, desiredKey); }
public void WordPrefixUpper() { AWord word = new AWord("CaBat", m_source.CharacterCategorizer); Assert.AreEqual("Ca", word.Prefix); }
public void WordNoSuffixUpper() { AWord word = new AWord("BAT", m_source.CharacterCategorizer); Assert.AreEqual("", word.Suffix); }
public void WordPrefixLowerWithTitle() { AWord word = new AWord("ca\u01C5at", m_source.CharacterCategorizer); Assert.AreEqual("ca", word.Prefix); }
public void WordWithNumberNoSuffix() { AWord word = new AWord("1Co", m_source.CharacterCategorizer); Assert.AreEqual("", word.Suffix); }
public void WordNoPrefixLower() { AWord word = new AWord("bat", m_source.CharacterCategorizer); Assert.AreEqual("", word.Prefix); }
public void WordSuffix() { AWord word = new AWord("DavidBen", m_source.CharacterCategorizer); Assert.AreEqual("Ben", word.Suffix); }