edu.stanford.nlp.semgrex
Class Alignment
java.lang.Object
edu.stanford.nlp.semgrex.Alignment
public class Alignment
- extends 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
|
Method Summary |
boolean |
equals(Object o)
Defined on map only. |
String |
getJustification()
|
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,
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. |
String |
toString()
|
String |
toString(String format)
|
score
protected double score
Alignment
public Alignment(Map<IndexedWord,IndexedWord> map,
double score,
String justification)
getScore
public double getScore()
getMap
public Map<IndexedWord,IndexedWord> getMap()
getJustification
public String getJustification()
toString
public String toString()
- Overrides:
toString
in class Object
toString
public String toString(String format)
equals
public boolean equals(Object o)
- Defined on map only.
- Overrides:
equals
in class Object
hashCode
public int hashCode()
- Defined on map only.
- Overrides:
hashCode
in class Object
makeFromIndexArray
public static Alignment makeFromIndexArray(SemanticGraph txtGraph,
SemanticGraph hypGraph,
int[] indexes,
double score,
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