示例#1
0
        public void GetStopWords_ForEN_ShouldReturnNoOfWords(string lang, int noOfWords)
        {
            var r = StopWords.GetStopWords(lang);

            Assert.NotNull(r);
            Assert.Equal(noOfWords, r.Length);
        }
示例#2
0
        private static string Remove(string s, string shortLanguageName)
        {
            var stopWordList = StopWords.GetStopWords(shortLanguageName);

            s = s.Split(' ').Where(x => !stopWordList.Contains(x)).DefaultIfEmpty().Aggregate((current, next) => current + " " + next);

            return(s ?? String.Empty);
        }
示例#3
0
        public void GetStopWords_ForCurrentCulture_ShouldBeNotNull()
        {
            CultureInfo culture = CultureInfo.GetCultureInfo("en-US");

            CultureInfo.CurrentCulture = culture;
            var r = StopWords.GetStopWords();

            Assert.NotNull(r);
        }