|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objecthultig.sumo.ParaphAlignPair
public class ParaphAlignPair
This class represents an aligned paraphrase pair, that is a paraphrasic sentence pair having their common and similar words aligned. This class enables alignment representation with various levels of interpretation: lexical, syntactical, and at the chunk level.
University of Beira Interior (UBI)
Centre For Human Language Technology and Bioinformatics (HULTIG)
Constructor Summary | |
---|---|
ParaphAlignPair(String sa,
String sb)
The default constructor is based on the two sentence strings. |
|
ParaphAlignPair(String sa,
String sb,
OpenNLPKit model)
A more general constructor where a language model is taken to be used for shallow parsing. |
Method Summary | |
---|---|
void |
align(POSType postype)
Uses the Needleman Wunsch algorithm for globally align the paraphrasic sentences of this class. |
void |
codify(CorpusIndex dic)
Codifies the aligned sentences according to a given corpus index. |
void |
codifyChunks(POSType postype)
Codifies the chunks of the aligned sentences according to a given part-of-speech tag set. |
String[] |
colorizedChunks()
Gives the string pair containing this alignment, marked with XML chromatic tags. |
String[] |
colorizedChunks(POSType post)
Gives the string pair containing this alignment, marked with XML chromatic tags. |
Vector<XBubble> |
extractBubblesWithBoundaries()
A new version of the extractNXBubbles() method
in which the BEGIN and END meta-tags are considered. |
Vector<XBubble> |
extractNXBubbles()
Extracts all possible bubbles from an aligned paraphrase. |
Vector<XBubble> |
extractNXBubbles(double minValue)
Extracts all possible bubbles from an aligned paraphrase. |
static void |
main(String[] args)
The main method exemplifies the use of this class. |
static int |
numTrueWords(Word[] v)
Count the number of true words, contained in a given array of words. |
void |
print()
A shortcut for the print(int level)
method, with level equal to 3. |
void |
print(int level)
Outputs this alignment. |
void |
printWithColors()
Outputs this alignment marked with XML chromatic tags. |
int |
size()
The length of this alignment, in terms of the number of tokens in each sentence, including the void tokens, marked usualy with sequences of underscores. |
String[] |
subSequence(int a,
int b)
Gives a sub-sequence of this alignment, delimited by two positions. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ParaphAlignPair(String sa, String sb)
sa
- One sentence string.sb
- The other sentence string.public ParaphAlignPair(String sa, String sb, OpenNLPKit model)
sa
- One sentence string.sb
- The other sentence string.model
- The language model.Method Detail |
---|
public void align(POSType postype)
postype
- The definition of the POS tags, to mark the
generated alignment.public void codify(CorpusIndex dic)
dic
- The corpus index.public void codifyChunks(POSType postype)
postype
- The POS set considered.public int size()
public String[] subSequence(int a, int b)
a
- The left position.b
- The right positions
public Vector<XBubble> extractNXBubbles(double minValue)
minValue
- The minimum value upon which a bubble is
extracted.
public Vector<XBubble> extractNXBubbles()
public Vector<XBubble> extractBubblesWithBoundaries()
extractNXBubbles()
method
in which the BEGIN
and END
meta-tags are considered. If one
of the contexts is equal to one of this tags, the value of the bubble is
recomputed differently taking into account only the other context.
public static int numTrueWords(Word[] v)
v
- The given array of words.
public void print()
print(int level)
method, with level equal to 3.
public void print(int level)
level
- A code stating the amount of information to
be printed in the standard output.public String[] colorizedChunks()
colorTags(int cod)
.
public String[] colorizedChunks(POSType post)
colorTags(int cod)
. If the parameter flag is
active (true), and array with four strings is returned, where the third and
fourth ones are corresponding part-of-speech strings for the first and
second strings. These last two contain the chromatic marked sentences.
withPOS
- The part-of-speech flag.
withPOS
flag.public void printWithColors()
public static void main(String[] args)
args
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |