*
* @param surfaceFormOccurrence the surface form in context
* @return POS tag of the previous token
*/
public static Integer prePOS(SurfaceFormOccurrence surfaceFormOccurrence) {
TaggedToken leftNeighbour = null;
try {
leftNeighbour = ((TaggedText) surfaceFormOccurrence.context()).taggedTokenProvider()
.getLeftNeighbourToken(surfaceFormOccurrence);
} catch (ItemNotFoundException e) {
return null;
}
TaggedToken rightNeighbour = null;
try {
rightNeighbour = ((TaggedText) surfaceFormOccurrence.context()).taggedTokenProvider()
.getRightNeighbourToken(surfaceFormOccurrence);
} catch (ItemNotFoundException e) {
}
if (leftNeighbour.getPOSTag().equals("pp$") && (rightNeighbour != null && rightNeighbour.getPOSTag().equals("in")))
return 0;
else if (leftNeighbour.getToken().equals("of"))
return 2;
else if (leftNeighbour.getPOSTag().equals("in"))
return 1;