Exemplo n.º 1
0
        private static SummarizedDocument CreateSummarizedDocument(Article article, SummarizerArguments args)
        {
            SummarizedDocument sumDoc = new SummarizedDocument();

            sumDoc.Concepts = article.Concepts;
            foreach (Sentence sentence in article.Sentences)
            {
                if (sentence.Selected)
                {
                    sumDoc.Sentences.Add(sentence.OriginalSentence);
                }
            }
            return(sumDoc);
        }
Exemplo n.º 2
0
        public static SummarizedDocument Summarize(SummarizerArguments args)
        {
            if (args == null)
            {
                return(null);
            }
            Article article = null;

            if (args.InputString.Length > 0 && args.InputFile.Length == 0)
            {
                article = ParseDocument(args.InputString, args);
            }
            else
            {
                article = ParseFile(args.InputFile, args);
            }
            Grader.Grade(article);
            Highlighter.Highlight(article, args);
            SummarizedDocument sumdoc = CreateSummarizedDocument(article, args);

            return(sumdoc);
        }