public void GetStopWords_ForEN_ShouldReturnNoOfWords(string lang, int noOfWords) { var r = StopWords.GetStopWords(lang); Assert.NotNull(r); Assert.Equal(noOfWords, r.Length); }
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); }
public void GetStopWords_ForCurrentCulture_ShouldBeNotNull() { CultureInfo culture = CultureInfo.GetCultureInfo("en-US"); CultureInfo.CurrentCulture = culture; var r = StopWords.GetStopWords(); Assert.NotNull(r); }