Ejemplo n.º 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);
        }
Ejemplo n.º 2
0
 public void addSection(PatternExpanderPhraseSection section)
 {
     if (next == null)
     {
         next = section;
     }
     else
     {
         next.addSection(section);
     }
 }