コード例 #1
0
ファイル: keyword_ga.cs プロジェクト: Chriz-ONeill/PxStat
        //
        /// <summary>
        /// If 'h' is the second letter of the word, remove it (in certain cases!)
        /// </summary>
        /// <param name="word"></param>
        /// <returns></returns>
        private string RemoveAspiration(string word)
        {
            string        outWord        = word;
            List <string> aspirationList = keyword.GetStringList("inflection.aspiration");

            foreach (string s in aspirationList)
            {
                if (word.StartsWith(s) && s.Length >= 2 && word.Length >= 3)
                {
                    outWord = word.Substring(0, 1) + word.Substring(2, word.Length - 2);
                }
            }

            return(outWord);
        }
コード例 #2
0
        /// <summary>
        /// Indicates if a word is one of a specific list of number that are not to be processed. These words will not be added to the output.
        /// </summary>
        /// <param name="word"></param>
        /// <returns></returns>
        internal bool IsExcluded(string word)
        {
            if (word.Length < 2)
            {
                return(true);
            }

            List <string> wordList = keyword.GetStringList("excluded.article");

            wordList.AddRange(keyword.GetStringList("excluded.preposition"));
            wordList.AddRange(keyword.GetStringList("excluded.interrogative"));
            wordList.AddRange(keyword.GetStringList("excluded.miscellaneous"));


            if (wordList.Contains(word.ToLower()))
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }