Skip to content

Tokensregex error with operator "+" (plus) #1256

@jpi-seb

Description

@jpi-seb

Hi,
I just encountered this error while trying the tokensregex syntax at http://corenlp.run/

  • Version 4.4.0
  • Example of a working pattern: the very* first? day of the tentacle
    image
  • Example of a failing pattern: the very* first? day+ of the tentacle
    image

It seems that the + character is escaped as \+ at some point of the process (see the error screenshot).
If I try the pattern the very* first? day{1,} of the tentacle, it works as expected.

I also tried to parse the same pattern with the CoreNLP Java library in version 4.4.0, and it works without error with the "+" operator.

String strPattern = "the very* first? day+ of the tentacle";
		
TokenSequenceParser parser = new TokenSequenceParser();
Env env = new Env(parser);
env.initDefaultBindings();
Pair<PatternExpr, SequenceMatchAction<CoreMap>> p = parser.parseSequenceWithAction(env, strPattern);

// => works without error !

I don't know if the problem is just present on the http://corenlp.run/ online tester, or in a Java lib that I haven't tried.

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