se.lth.cs.nlp.nlputils.alignment
Class Alignment

java.lang.Object
  extended by se.lth.cs.nlp.nlputils.alignment.Alignment

public class Alignment
extends Object

Word alignment.

Author:
Richard Johansson (richard@cs.lth.se)

Constructor Summary
Alignment(String initStr)
          Constructor from alignment string in the format used by GIZA++.
 
Method Summary
 int[] getIndices(int index)
          Returns an array of indices that the token at position index is projected to.
 Pair<Integer,Integer> maxSpan(int start, int end)
          Finds the maximal span of all projected positions between start and end.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Alignment

public Alignment(String initStr)
Constructor from alignment string in the format used by GIZA++.

Parameters:
initStr - the alignment string.
Method Detail

getIndices

public int[] getIndices(int index)
Returns an array of indices that the token at position index is projected to.

Parameters:
index - the position of the token to project.
Returns:
the array of projected indices.

maxSpan

public Pair<Integer,Integer> maxSpan(int start,
                                     int end)
Finds the maximal span of all projected positions between start and end.

Parameters:
start - the position of the start token.
end - the position of the end token.
Returns:
the projected span.