Example #1
0
        public static bool Contains(string word)
        {
            if (_stopWords == null)
            {
                _stopWords = new StopWords(Constants.DefaultStopWordsFile);
            }

            return(_stopWords.Has(word));
        }
Example #2
0
        public static string RemoveStopWords(this string content)
        {
            // TODO
            var words = content.ToLower().Split(' ', '\n');

            var collection = from word in words
                             let w = word.Trim(new[] { ' ', ',', '.', ';', '(', '[', ']', '*', ')', '"', '\'', '\r', '\n' })
                                     where !string.IsNullOrEmpty(w) && !StopWords.Contains(w)
                                     select w;

            return(string.Join(Constants.Separator, collection));
        }