예제 #1
0
 private void addTreeToAlphabet(DepTree tree) {
   for (DepTreeNode node : tree) {
     if (node.getLabel() != WallDepTreeNode.WALL_LABEL) {
       int idx = alphabet.lookupIndex(node.getLabel());
       if (idx == -1) {
         throw new RuntimeException("Unknown label: " + node.getLabel());
       }
     }
   }
 }
예제 #2
0
 public Set<String> getTypes() {
   Set<String> types = new HashSet<String>();
   for (DepTree tree : this) {
     for (DepTreeNode node : tree) {
       types.add(node.getLabel());
     }
   }
   types.remove(WallDepTreeNode.WALL_LABEL);
   return types;
 }