@Override public boolean incrementToken() throws IOException { if(sentences.hasNext()){ sentence = sentences.next(); termAtt.setEmpty().append(sentence.getSpan()); offsetAtt.setOffset(sentence.getStart(),sentence.getEnd()); typeAtt.setType("sentence"); return true; } else { return false; } }
@Override public boolean incrementToken() throws IOException { if(sentences.hasNext()){ sentence = sentences.next(); termAtt.setEmpty().append(sentence.getSpan()); offsetAtt.setOffset(sentence.getStart(),sentence.getEnd()); typeAtt.setType("sentence"); return true; } else { return false; } }
@Override public boolean incrementToken() throws IOException { if(sentences.hasNext()){ sentence = sentences.next(); termAtt.setEmpty().append(sentence.getSpan()); offsetAtt.setOffset(sentence.getStart(),sentence.getEnd()); typeAtt.setType("sentence"); return true; } else { return false; } }
Sentence s = at.addSentence(offset.startOffset(), offset.endOffset()); if(log.isTraceEnabled()) { log.trace("detected {}:{}",s,s.getSpan());
Sentence s = at.addSentence(offset.startOffset(), offset.endOffset()); if(log.isTraceEnabled()) { log.trace("detected {}:{}",s,s.getSpan());
CharSequence phraseText = at.getText().subSequence(sentPhrase.getStartIndex(), sentPhrase.getEndIndex()); log.debug("Write SentimentPhrase for {} (sentence: {})", phraseText, sentence == null ? "none" : sentence.getSpan().length() > 17 ? (sentence.getSpan().subSequence(0,17) + "...") : sentence.getSpan()); List<Sentiment> sentiments = sentPhrase.getSentiments(); log.debug(" > {} Sentiments:",sentiments.size()); } else { metadata.add(new TripleImpl(enh, ENHANCER_SELECTION_CONTEXT, new PlainLiteralImpl(sentPhrase.getSentence().getSpan(),lang)));
new PlainLiteralImpl(context == null ? getDefaultSelectionContext(at.getSpan(), span.getSpan(), span.getStart()) : context.getSpan(), lang)));