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));
            }
        }
Пример #2
0
 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;
 }
Пример #3
0
        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);
        }