Item.java :  » Natural-Language-Processing » Stanford-CoreNLP » edu » stanford » nlp » parser » lexparser » Java Open Source

Java Open Source » Natural Language Processing » Stanford CoreNLP 
Stanford CoreNLP » edu » stanford » nlp » parser » lexparser » Item.java
package edu.stanford.nlp.parser.lexparser;

import edu.stanford.nlp.util.Scored;


/** Abstract class for parse items.
 *
 *  @author Dan Klein
 */
abstract public class Item implements Scored {

  public int start;
  public int end;
  public int state;
  public int head;
  public int tag;
  public Edge backEdge;
  public double iScore = Double.NEGATIVE_INFINITY;
  public double oScore = Double.NEGATIVE_INFINITY;

  public Item() {}
  
  public Item(Item item) {
    start = item.start;
    end = item.end;
    state = item.state;
    head = item.head;
    tag = item.tag;
    backEdge = item.backEdge;
    iScore = item.iScore;
    oScore = item.oScore;
  }
  
  public double score() {
    if (Test.exhaustiveTest) {
      return iScore;
    } else {
      return iScore + oScore;
    }
  }

  public boolean isEdge() {
    return false;
  }

  public boolean isPreHook() {
    return false;
  }

  public boolean isPostHook() {
    return false;
  }

}
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.