<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Recent changes to class structure</title><link>https://sourceforge.net/p/sequencetree/wiki/class%2520structure/</link><description>Recent changes to class structure</description><atom:link href="https://sourceforge.net/p/sequencetree/wiki/class%20structure/feed" rel="self"/><language>en</language><lastBuildDate>Sun, 11 Sep 2011 03:44:26 -0000</lastBuildDate><atom:link href="https://sourceforge.net/p/sequencetree/wiki/class%20structure/feed" rel="self" type="application/rss+xml"/><item><title>WikiPage class structure modified by Ken Del Signore</title><link>https://sourceforge.net/p/sequencetree/wiki/class%2520structure/</link><description>&lt;pre&gt;--- v7 
+++ v8 
@@ -66,7 +66,7 @@
         }
     }
 
-The add_sequence() function operates on a vector of Objects:
+The add_sequence() function operates on a vector of Objects.  To add a sequence [A, B, C] to a tree, we call add_sequence(o), where o points to the first object in the vector.
 
     Object: :add_sequence( vector&lt;Object&gt;: :iterator o){
        if (o-&gt;lemma == "") return
&lt;/pre&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Ken Del Signore</dc:creator><pubDate>Sun, 11 Sep 2011 03:44:26 -0000</pubDate><guid>https://sourceforge.net7f5bc43df571ad03b70d66720b87e1b6e3fd7746</guid></item><item><title>WikiPage class structure modified by Ken Del Signore</title><link>https://sourceforge.net/p/sequencetree/wiki/class%2520structure/</link><description>&lt;pre&gt;--- v6 
+++ v7 
@@ -69,7 +69,7 @@
 The add_sequence() function operates on a vector of Objects:
 
     Object: :add_sequence( vector&lt;Object&gt;: :iterator o){
-       if (lemma == "") return
+       if (o-&gt;lemma == "") return
        for (b=branches.begin; b!=branches.end){
           if (o-&gt;lemma == b-&gt;lemma){
              b-&gt;count++
&lt;/pre&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Ken Del Signore</dc:creator><pubDate>Sat, 10 Sep 2011 05:48:21 -0000</pubDate><guid>https://sourceforge.net5238a377543ceea2d754b6b09571a2b32801fcf0</guid></item><item><title>WikiPage class structure modified by Ken Del Signore</title><link>https://sourceforge.net/p/sequencetree/wiki/class%2520structure/</link><description>&lt;pre&gt;--- v5 
+++ v6 
@@ -83,3 +83,37 @@
        branches.back().add_sequence(++o)
     }
 
+An example main() function to build and print the tree would be:
+
+    main(){
+
+      Object A, B, C
+      A-&gt;lemma="A"
+      B-&gt;lemma="B"
+      C-&gt;lemma="C"
+      vector&lt;Object&gt; v1 = [ A, B, C ]
+      vector&lt;Object&gt; v2 = [ A, B, D ]
+
+      Object tree
+      vector: :iterator o=v1.begin
+      tree.add_sequence(o)
+      tree.add_sequence(o)
+
+      o = v2.begin()
+      tree.add_sequence(o)
+
+      tree.sort_branches()
+      tree.printout()
+    }   
+
+
+This would printout the tree:
+
+    A :3
+         B :3
+              C :2
+              D :1
+
+
+The class used in the ensuing analysis is expanded from the above definition.  But the general framework is the same.
+
&lt;/pre&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Ken Del Signore</dc:creator><pubDate>Sat, 10 Sep 2011 05:46:27 -0000</pubDate><guid>https://sourceforge.net32274f3ff5686c44d864cc2e93aefa9cc26adf35</guid></item><item><title>WikiPage class structure modified by Ken Del Signore</title><link>https://sourceforge.net/p/sequencetree/wiki/class%2520structure/</link><description>&lt;pre&gt;--- v4 
+++ v5 
@@ -51,10 +51,35 @@
 
 The member functions are all recursive: (in pseudo code) 
 
-     Object::printout(int depth){
+    Object: :printout(int depth){
       for( i =0; i&lt;depth;i++) cout&lt;&lt;"   "
       cout&lt;&lt;lemma&lt;&lt;" :"&lt;&lt;count&lt;&lt;endl
-      printout(depth+1)
-    }
-
+      for (b=branches.begin; b!=branches.end){
+          b-&gt;printout(depth+1)
+       }
+    }
+
+    Object: :sort_branches(){
+        branches.sort()
+        for (b=branches.begin; b!=branches.end){
+            b-&gt;sort_branches()
+        }
+    }
+
+The add_sequence() function operates on a vector of Objects:
+
+    Object: :add_sequence( vector&lt;Object&gt;: :iterator o){
+       if (lemma == "") return
+       for (b=branches.begin; b!=branches.end){
+          if (o-&gt;lemma == b-&gt;lemma){
+             b-&gt;count++
+             b-&gt;add_sequence(++o)
+             return
+          }
+       }      
+       // new branch
+       Object new_branch(*o)
+       branches.push_back(new_branch)
+       branches.back().add_sequence(++o)
+    }
 
&lt;/pre&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Ken Del Signore</dc:creator><pubDate>Sat, 10 Sep 2011 05:33:28 -0000</pubDate><guid>https://sourceforge.netb0eac50d05b425e11861631a114526646dc9479f</guid></item><item><title>WikiPage class structure modified by Ken Del Signore</title><link>https://sourceforge.net/p/sequencetree/wiki/class%2520structure/</link><description>&lt;pre&gt;--- v3 
+++ v4 
@@ -49,3 +49,12 @@
 
 
 
+The member functions are all recursive: (in pseudo code) 
+
+     Object::printout(int depth){
+      for( i =0; i&lt;depth;i++) cout&lt;&lt;"   "
+      cout&lt;&lt;lemma&lt;&lt;" :"&lt;&lt;count&lt;&lt;endl
+      printout(depth+1)
+    }
+
+
&lt;/pre&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Ken Del Signore</dc:creator><pubDate>Sat, 10 Sep 2011 05:12:28 -0000</pubDate><guid>https://sourceforge.net5b2c2bd55d40f1d488ef12495d9ab932f39e47ad</guid></item><item><title>WikiPage class structure modified by Ken Del Signore</title><link>https://sourceforge.net/p/sequencetree/wiki/class%2520structure/</link><description>&lt;pre&gt;--- v2 
+++ v3 
@@ -14,13 +14,15 @@
 
 
 In the following example tree:
+
     A :3
          B :3
               C :2
               D :1
 
 
 The object instances would be:
+
      Object A {
                lemma = "A"
                count = 3
&lt;/pre&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Ken Del Signore</dc:creator><pubDate>Fri, 09 Sep 2011 11:44:04 -0000</pubDate><guid>https://sourceforge.net0711c126d5146e5192290eb996a9aa3e0956ba21</guid></item><item><title>WikiPage class structure modified by Ken Del Signore</title><link>https://sourceforge.net/p/sequencetree/wiki/class%2520structure/</link><description>&lt;pre&gt;--- v1 
+++ v2 
@@ -1,13 +1,49 @@
-class Object{
-public:
-  string lemma;
-  int count;
-  
-  list&lt;Object&gt; branches;
- 
-  void    add_sequence(  vector&lt;Object&gt;::iterator );
-  void    sort_branches();
-  void    printout(int);
- 
-}
+Each node of the tree is an instance of the "Object" class below.  
+
+    class Object{
+    public:
+      string lemma;              // identifier
+      int    count;              
+      list&lt;Object&gt; branches;
+ 
+      void    add_sequence(  vector&lt;Object&gt;::iterator );
+      void    sort_branches();
+      void    printout(int);
+     }
+
+
+
+In the following example tree:
+    A :3
+         B :3
+              C :2
+              D :1
+
+
+The object instances would be:
+     Object A {
+               lemma = "A"
+               count = 3
+               branches = [ B ]
+               } 
+
+     Object B {
+               lemma = "B"
+               count = 3
+               branches = [ C,D ]
+               } 
+
+     Object C {
+               lemma = "C"
+               count = 2
+               branches = [ ]
+               } 
+
+     Object D {
+               lemma = "D"
+               count = 1
+               branches = [ ]
+               } 
+
+
 
&lt;/pre&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Ken Del Signore</dc:creator><pubDate>Fri, 09 Sep 2011 11:43:47 -0000</pubDate><guid>https://sourceforge.net751112c5024bf8dcb4cd334fe058788594faea6f</guid></item><item><title>WikiPage class structure modified by Ken Del Signore</title><link>https://sourceforge.net/p/sequencetree/wiki/class%2520structure/</link><description>class Object{
public:
  string lemma;
  int count;
  
  list&lt;Object&gt; branches;
 
  void    add_sequence(  vector&lt;Object&gt;::iterator );
  void    sort_branches();
  void    printout(int);
 
}

</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Ken Del Signore</dc:creator><pubDate>Thu, 08 Sep 2011 04:13:24 -0000</pubDate><guid>https://sourceforge.netf7a429ed2b3af5447e6b0471ac1330c287e058bb</guid></item></channel></rss>