public static WordHistogram BuildHistogramFromText(string textFr)
        {
            var splitWords = textFr.Split(new[] { " ", "\n", "\r" }, StringSplitOptions.RemoveEmptyEntries);
            var hist = new WordHistogram();
            foreach (var wordDirty in splitWords)
            {
                var wordClean = StripSymbols(wordDirty);
                if (string.IsNullOrEmpty(wordClean))
                    continue;
                hist.AddWord(wordClean.ToLower());
            }

            return hist;
        }
Esempio n. 2
0
        public static WordHistogram BuildHistogramFromText(string textFr)
        {
            var splitWords = textFr.Split(new[] { " ", "\n", "\r" }, StringSplitOptions.RemoveEmptyEntries);
            var hist       = new WordHistogram();

            foreach (var wordDirty in splitWords)
            {
                var wordClean = StripSymbols(wordDirty);
                if (string.IsNullOrEmpty(wordClean))
                {
                    continue;
                }
                hist.AddWord(wordClean.ToLower());
            }

            return(hist);
        }