throw new IllegalArgumentException(
"The parsed offset MUST NOT be a negative number (offset="+offset+")");
}
this.offset = offset;
Span[] tokenSpans = getTokenizer().tokenizePos(sentence);
POSTaggerME tagger = getPosTagger();
ChunkerME chunker = getChunker();
PosTypeChunker posTypeChunker = getPosTypeChunker();
String[] tokens = new String[tokenSpans.length];
for(int ti = 0; ti<tokenSpans.length;ti++) {
tokens[ti] = tokenSpans[ti].getCoveredText(sentence).toString();
}
String[][] posTags;
double[][] posProbs;
Span[] chunkSpans;
double[] chunkProps;
if(tagger != null){
posTags = new String[tokens.length][];
posProbs = new double[tokens.length][];
//get the topK POS tags and props and copy it over to the 2dim Arrays
Sequence[] posSequences = tagger.topKSequences(tokens);
//extract the POS tags and props for the current token from the
//posSequences.
//NOTE: Sequence includes always POS tags for all Tokens. If
// less then posSequences.length are available it adds the
// best match for all followings.