예제 #1
0
        private void addSectionEntries(String s)
        {
            // create a new section
            PatternExpanderPhraseSection section = new PatternExpanderPhraseSection();

            // create a new string to put in the section
            String cur = "";

            // go through the text, grabbing characters and adding strings to
            // the section when ',' is found

            for (int i = 0; i < s.Length; ++i)
            {
                if (s[i] == ',')
                {
                    // found a ',' so submit the built string to the section.
                    section.addString(cur);
                    cur = "";
                }
                else
                {
                    // no ',' yet, so we are building a string
                    cur += s[i];
                }
            }
            // cur contains the last string built without ending with ',' so
            // we need to add it here

            section.addString(cur);

            // append this entire section to the end of our section list
            sections.addSection(section);
        }
예제 #2
0
 public void addSection(PatternExpanderPhraseSection section)
 {
     if (next == null)
     {
         next = section;
     }
     else
     {
         next.addSection(section);
     }
 }
예제 #3
0
 public void clear()
 {
     strings.Clear();
     next = null;
 }
예제 #4
0
 public PatternExpanderPhraseSection()
 {
     strings = new LinkedList <String>();
     next    = null;
 }
예제 #5
0
 public PatternExpanderPhrase(PatternExpanderTarget target) : base(target)
 {
     sections = new PatternExpanderPhraseSection();
 }