Ejemplo n.º 1
0
        public void GetStopWords_ForEN_ShouldReturnNoOfWords(string lang, int noOfWords)
        {
            var r = StopWords.GetStopWords(lang);

            Assert.NotNull(r);
            Assert.Equal(noOfWords, r.Length);
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 3
0
        public void GetStopWords_ForCurrentCulture_ShouldBeNotNull()
        {
            CultureInfo culture = CultureInfo.GetCultureInfo("en-US");

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

            Assert.NotNull(r);
        }