예제 #1
0
        /// ------------------------------------------------------------------------------------
        /// <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);
        }
예제 #2
0
		/// ------------------------------------------------------------------------------------
		/// <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);
		}
예제 #3
0
        public void WordPrefixUpper()
        {
            AWord word = new AWord("CaBat", m_source.CharacterCategorizer);

            Assert.AreEqual("Ca", word.Prefix);
        }
예제 #4
0
        public void WordNoSuffixUpper()
        {
            AWord word = new AWord("BAT", m_source.CharacterCategorizer);

            Assert.AreEqual("", word.Suffix);
        }
예제 #5
0
        public void WordPrefixLowerWithTitle()
        {
            AWord word = new AWord("ca\u01C5at", m_source.CharacterCategorizer);

            Assert.AreEqual("ca", word.Prefix);
        }
예제 #6
0
        public void WordWithNumberNoSuffix()
        {
            AWord word = new AWord("1Co", m_source.CharacterCategorizer);

            Assert.AreEqual("", word.Suffix);
        }
예제 #7
0
        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);
		}
예제 #9
0
        public void WordSuffix()
        {
            AWord word = new AWord("DavidBen", m_source.CharacterCategorizer);

            Assert.AreEqual("Ben", word.Suffix);
        }
		public void WordPrefixUpper()
		{
			AWord word = new AWord("CaBat", m_source.CharacterCategorizer);
			Assert.AreEqual("Ca", word.Prefix);
		}
		public void WordPrefixLowerWithTitle()
		{
			AWord word = new AWord("ca\u01C5at", 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 WordNoPrefixLower()
		{
			AWord word = new AWord("bat", m_source.CharacterCategorizer);
			Assert.AreEqual("", word.Prefix);
		}
		public void WordWithNumberNoSuffix()
		{
			AWord word = new AWord("1Co", m_source.CharacterCategorizer);
			Assert.AreEqual("", word.Suffix);
		}