/** * Getter for the text covered by the next tokenCount tokens relative to * {@link #token}. It uses the {@link #textCache} to lookup/store such texts. * Given the Tokens * <pre> * [This, is, an, Example] * </pre> * and the parameter <code>3</code> this method will return * <pre> * This is an * </pre> * @param tokenCount the number of tokens to be included relative to * {@link #tokenIndex} * @return the text covered by the span start of {@link #token} to end of * token at <code>{@link #tokenIndex}+tokenCount</code>. */ public String getTokenText(int start, int tokenCount){ int offset = section.getStart(); return section.getSpan().substring( tokens.get(start).token.getStart()-offset, tokens.get(start+(tokenCount-1)).token.getEnd()-offset); }
/** * Getter for the text covered by the next tokenCount tokens relative to * {@link #token}. It uses the {@link #textCache} to lookup/store such texts. * Given the Tokens * <pre> * [This, is, an, Example] * </pre> * and the parameter <code>3</code> this method will return * <pre> * This is an * </pre> * @param tokenCount the number of tokens to be included relative to * {@link #tokenIndex} * @return the text covered by the span start of {@link #token} to end of * token at <code>{@link #tokenIndex}+tokenCount</code>. */ public String getTokenText(int start, int tokenCount){ int offset = section.getStart(); return section.getSpan().substring( tokens.get(start).token.getStart()-offset, tokens.get(start+(tokenCount-1)).token.getEnd()-offset); }
while(!foundLinkableToken && sections.hasNext()){ section = sections.next(); if(consumedSectionIndex > section.getStart()){ log.debug(" > skipping {} because an other section until Index {} " + "was already processed. This is not an error, but indicates that" +
while(!foundLinkableToken && sections.hasNext()){ section = sections.next(); if(consumedSectionIndex > section.getStart()){ log.debug(" > skipping {} because an other section until Index {} " + "was already processed. This is not an error, but indicates that" +
sentences.get(Math.max(0, i-1)).getStart(), sentences.get(Math.min(sentences.size()-1, i+1)).getEnd());
lf.createTypedLiteral(section.getStart()))); metadata.add(new TripleImpl(enh, ENHANCER_END, lf.createTypedLiteral(section.getEnd())));