/**
   * Returns the dimension number corresponding to the term at the end of the provided path.
   *
   * @param path a path whose end represents a semantic connection
   * @return the dimension for the occurrence of the last word in the path
   */
  public int getDimension(DependencyPath path) {
    String endToken = path.last().word();

    // Extract out how the current word is related to the last word in the
    // path.
    String relation = path.getRelation(path.length() - 1);
    return getDimensionInternal(endToken + "+" + relation);
  }
예제 #2
0
 public PathSignature(DependencyPath path) {
   relations = new String[path.length() - 1];
   for (int i = 0; i < path.length(); ++i) {
     if (i + 1 < path.length()) relations[i] = path.getRelation(i);
   }
 }