edu.stanford.nlp.semgrex
Class Alignment

java.lang.Object
  extended by edu.stanford.nlp.semgrex.Alignment

public class Alignment
extends java.lang.Object

Represents an alignment between a text and a hypothesis as a map from hypothesis words to text words, along with a real-valued score and (optionally) a justification string.

Author:
Bill MacCartney

Field Summary
protected  double score
           
 
Constructor Summary
Alignment(java.util.Map<IndexedWord,IndexedWord> map, double score, java.lang.String justification)
           
 
Method Summary
 boolean equals(java.lang.Object o)
          Defined on map only.
 java.lang.String getJustification()
           
 java.util.Map<IndexedWord,IndexedWord> getMap()
           
 double getScore()
           
 int hashCode()
          Defined on map only.
static Alignment makeFromIndexArray(SemanticGraph txtGraph, SemanticGraph hypGraph, int[] indexes)
           
static Alignment makeFromIndexArray(SemanticGraph txtGraph, SemanticGraph hypGraph, int[] indexes, double score)
           
static Alignment makeFromIndexArray(SemanticGraph txtGraph, SemanticGraph hypGraph, int[] indexes, double score, java.lang.String justification)
          Constructs and returns a new Alignment from the given hypothesis SemanticGraph to the given text (passage) SemanticGraph, using the given array of indexes.
 java.lang.String toString()
           
 java.lang.String toString(java.lang.String format)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

score

protected double score
Constructor Detail

Alignment

public Alignment(java.util.Map<IndexedWord,IndexedWord> map,
                 double score,
                 java.lang.String justification)
Method Detail

getScore

public double getScore()

getMap

public java.util.Map<IndexedWord,IndexedWord> getMap()

getJustification

public java.lang.String getJustification()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

toString

public java.lang.String toString(java.lang.String format)

equals

public boolean equals(java.lang.Object o)
Defined on map only.

Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Defined on map only.

Overrides:
hashCode in class java.lang.Object

makeFromIndexArray

public static Alignment makeFromIndexArray(SemanticGraph txtGraph,
                                           SemanticGraph hypGraph,
                                           int[] indexes,
                                           double score,
                                           java.lang.String justification)
Constructs and returns a new Alignment from the given hypothesis SemanticGraph to the given text (passage) SemanticGraph, using the given array of indexes. The i'th node of the array should contain the index of the node in the text (passage) SemanticGraph to which the i'th node in the hypothesis SemanticGraph is aligned, or -1 if it is aligned to NO_WORD.


makeFromIndexArray

public static Alignment makeFromIndexArray(SemanticGraph txtGraph,
                                           SemanticGraph hypGraph,
                                           int[] indexes)

makeFromIndexArray

public static Alignment makeFromIndexArray(SemanticGraph txtGraph,
                                           SemanticGraph hypGraph,
                                           int[] indexes,
                                           double score)


Stanford NLP Group