/** * Copies the elements of the parsed iterator to a list. * @param iterator the iterator * @return the List with all spans of the Iterators */ public static <T extends Span> List<T> asList(Iterator<T> it){ if(it == null || !it.hasNext()){ return Collections.emptyList(); } else { List<T> spans = new ArrayList<T>(); appandToList(it, spans); return spans; } } /**
/** * Copies the elements of the parsed iterator to a list. * @param iterator the iterator * @return the List with all spans of the Iterators */ public static <T extends Span> List<T> asList(Iterator<T> it){ if(it == null || !it.hasNext()){ return Collections.emptyList(); } else { List<T> spans = new ArrayList<T>(); appandToList(it, spans); return spans; } } /**
log.trace(" > use existing Sentence annotations for {}",at); sentenceList = new ArrayList<Section>(); AnalysedTextUtils.appandToList(sentences, sentenceList); } else { log.trace(" > use existing Tokens for {}",sentence); tokenList = new ArrayList<Token>(); //ensure an ArrayList is used AnalysedTextUtils.appandToList(tokens, tokenList);
List<Section> sentences = new ArrayList<Section>(); AnalysedTextUtils.appandToList(at.getSentences(), sentences); if(sentences.isEmpty()){ //no sentence annotations