bioasq icon indicating copy to clipboard operation
bioasq copied to clipboard

Bug: CoveringPhraseCavGenerator in generate function

Open noyessie opened this issue 8 years ago • 0 comments

This bug appear when some candidate answer variant don't have head tokens. After the first stream pipeline, Set<Token> heads = TypeUtil.getCandidateAnswerVariants(jcas).stream() .map(TypeUtil::getCandidateAnswerOccurrences).flatMap(Collection::stream) .map(TypeUtil::getHeadTokenOfAnnotation).collect(toSet()); one token is null ( only one because is a Set Collection).

After that, when you call Token::getHead in this part of code: Set<Token> parents = heads.stream().map(Token::getHead).filter(t -> t != null) .filter(t -> !heads.contains(t)).collect(toSet()); A NullPointerException occur.

For solve this, i think you need to put a non null filter.

regard.

noyessie avatar May 16 '17 12:05 noyessie