コード例 #1
0
ファイル: Parser.cs プロジェクト: DzmitryLakisau/TextParser
        public Text Parse(TextReader reader)
        {
            Text text = new Text();

            _sentenceItemFactory = new SentenceItemFactory(PunctuationFactory, WordFactory);
            string buffer = reader.ReadLine();

            while (buffer != null)
            {
                text.Lines.Add(ParseLine(buffer));
                buffer = reader.ReadLine();
            }

            Console.WriteLine("Text is parsed!");

            return(text);
        }
コード例 #2
0
ファイル: Parser.cs プロジェクト: DzmitryLakisau/TextParser
 public Sentence Parse(string source)
 {
     _sentenceItemFactory = new SentenceItemFactory(PunctuationFactory, WordFactory);
     return(ParseSentence(source));
 }