Beispiel #1
0
 // TODO properly override equals, hashCode?
 public virtual bool Equal(Edu.Stanford.Nlp.Parser.Nndep.DependencyTree t)
 {
     if (t.n != n)
     {
         return(false);
     }
     for (int i = 1; i <= n; ++i)
     {
         if (GetHead(i) != t.GetHead(i))
         {
             return(false);
         }
         if (!GetLabel(i).Equals(t.GetLabel(i)))
         {
             return(false);
         }
     }
     return(true);
 }
Beispiel #2
0
 public DependencyTree(Edu.Stanford.Nlp.Parser.Nndep.DependencyTree tree)
 {
     n     = tree.n;
     head  = new List <int>(tree.head);
     label = new List <string>(tree.label);
 }