示例#1
0
        public ClassificationResult Classify(String text)
        {
            var result = new ClassificationResult()
            {
                Trend = Trend.Unknown
            };

            foreach (var pattern in _provider.Patterns)
            {
                var articleText = TextCleaner.Clean(text);

                if (pattern.Regex.IsMatch(articleText))
                {
                    return(new ClassificationResult()
                    {
                        Trend = pattern.Trend, RegexText = pattern.RawRegexText
                    });
                }
            }

            return(result);
        }
示例#2
0
        public ClassificationResult Classify(IArticle article)
        {
            var articleText = TextCleaner.Clean(article.Text);

            return(Classify(articleText));
        }