public static IBlacklist GetDefaultBlacklist(string languageCode) { using (Stream s = Assembly.GetExecutingAssembly().GetManifestResourceStream(String.Format("CodingBreeze.WordCloud.Controls.TextAnalyses.Blacklist.Stopwords.stopwords_{0}.txt", languageCode.ToLowerInvariant()))) { if (s == null) { return(new NullBlacklist()); } return(CommonBlacklist.CreateFromStream(s)); } }
public static IBlacklist CreateFromStreamReader(TextReader reader) { if (reader == null) throw new ArgumentNullException("reader"); CommonBlacklist commonBlacklist = new CommonBlacklist(); using (reader) { string line = reader.ReadLine(); while (line != null) { line.Trim(); commonBlacklist.Add(line); line = reader.ReadLine(); } } return commonBlacklist; }
public static IBlacklist CreateFromStreamReader(TextReader reader) { if (reader == null) { throw new ArgumentNullException("reader"); } CommonBlacklist commonBlacklist = new CommonBlacklist(); using (reader) { string line = reader.ReadLine(); while (line != null) { line.Trim(); commonBlacklist.Add(line); line = reader.ReadLine(); } } return(commonBlacklist); }