tokensPairs.toArray(new IntPair[tokenSize]), tokens.toArray(new String[tokenSize]), new int[]{tokenSize}); copyViewsFromTo(ta, newTA, start, end, -start); return newTA;
tokensPairs.toArray(new IntPair[tokenSize]), tokens.toArray(new String[tokenSize]), new int[]{tokenSize}); copyViewsFromTo(ta, newTA, start, end, -start); return newTA;
/** * given a {@link TextAnnotation} for a sentence with annotations, map its annotations into a * TextAnnotation object for a longer text containing that sentence. * @param sentenceTa annotated TextAnnotation for sentence * @param textTa TextAnnotation for longer text containing sentence, without annotations for that sentence * @param sentenceId index of the sentence in the longer text */ static public void mapSentenceAnnotationsToText(TextAnnotation sentenceTa, TextAnnotation textTa, int sentenceId ) { assert(sentenceId < textTa.getNumberOfSentences()); assert(sentenceTa.getText().equals(textTa.getSentence(sentenceId).getText())); int start = textTa.getSentence(sentenceId).getStartSpan(); int end = textTa.getSentence(sentenceId).getEndSpan(); copyViewsFromTo(sentenceTa, textTa, start, end, start); }
/** * given a {@link TextAnnotation} for a sentence with annotations, map its annotations into a * TextAnnotation object for a longer text containing that sentence. * @param sentenceTa annotated TextAnnotation for sentence * @param textTa TextAnnotation for longer text containing sentence, without annotations for that sentence * @param sentenceId index of the sentence in the longer text */ static public void mapSentenceAnnotationsToText(TextAnnotation sentenceTa, TextAnnotation textTa, int sentenceId ) { assert(sentenceId < textTa.getNumberOfSentences()); assert(sentenceTa.getText().equals(textTa.getSentence(sentenceId).getText())); int start = textTa.getSentence(sentenceId).getStartSpan(); int end = textTa.getSentence(sentenceId).getEndSpan(); copyViewsFromTo(sentenceTa, textTa, start, end, start); }