Exemplo n.º 1
0
 public Boolean equals(EarleyEntry entry2) {
   if (entry2.getAncestor() == this.ancestor
       && entry2.getDot_pos() == this.getDot_pos()
       && entry2.getItemlist() == this.getItemlist()) {
     return true;
   }
   return false;
 }
Exemplo n.º 2
0
  public void adjustAncestor(Grammar grammar) {
    LinkedList<EarleyEntry> entry_stack = new LinkedList<EarleyEntry>();
    for (int i = 0; i < this.ancestor.size(); i++) {
      entry_stack.add(this.ancestor.get(i));
    }

    while (!entry_stack.isEmpty()) {
      EarleyEntry top = entry_stack.remove();
      this.ancestor.remove(top);
      if (!(top.ifComplete() || grammar.isPOSTAG(top.getHead().getSign()))) {
        Iterator<EarleyEntry> s = top.getAncestor().iterator();
        while (s.hasNext()) {
          entry_stack.add(s.next());
        }
      } else {
        this.ancestor.add(top);
      }
    }
  }
Exemplo n.º 3
0
 public EarleyEntry clone() {
   EarleyEntry copy = new EarleyEntry();
   copy.setAncestor(this.ancestor);
   copy.setDot_pos(this.dot_pos);
   copy.setItemlist(this.itemlist);
   copy.setOperation(this.operation);
   copy.setStart_pos(this.start_pos);
   copy.setend_pos(this.end_pos);
   return copy;
 }