Skip to content

Bug: CoveringPhraseCavGenerator in generate function #5

Open
@noyessie

Description

@noyessie

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions