示例#1
0
文件: Sentence.cs 项目: venyix/Lab2
        public void BreakIntoSentences()
        {
            int column;
            String token;
            String text = OriginalText;
            list = new SentenceList();

            while (!String.IsNullOrEmpty(text))
            {
                column = text.IndexOfAny(SentenceDelimiters.ToCharArray());

                if (column < 0)
                    column = text.Length;

                if (column == 0)
                    column = 1;

                token = text.Substring(0, (++column));
                text = text.Substring(column);
                text = text.Trim(" \t".ToCharArray());
                list.AddToList(token);
            }
        }