Skip to content

Regex Matching works improperly #193

Open
@heni

Description

@heni

I try next simple code

        String template = "[]|[]{2}";
        TokenSequencePattern pattern = TokenSequencePattern.compile(template);
        Annotation document = new Annotation("word1 word2");
        new TokenizerAnnotator(false, "en").annotate(document);
        List<CoreLabel> tokens = document.get(CoreAnnotations.TokensAnnotation.class);

        if (pattern.getMatcher(tokens).matches())
            System.out.println("OK!");
        else
            System.out.println("BAD :(");

and it prints "BAD :(" instead of expected "OK"

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions