We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hi,
I noticed a weird corner case when using uppercase letters in a regex. The following example parses fine:
final String grammar = "/nlp/\n" + "sent <- goo* name goo*\n" + "name <- 'Miro' \n" + "goo <- [0-9] / [a-z]/ ' '\n"; // adding "/ [A-Z]" here breaks it String txt = "hello Miro how are you"; try (GramExp peg = new GramExp(grammar)) { System.out.println(peg.parse(txt)); }
whereas the next two examples fail. I am only adding support for uppercase letters:
final String grammar = "/nlp/\n" + "sent <- goo* name goo*\n" + "name <- 'Miro' \n" + "goo <- [0-9] / [A-Z]/ ' '\n"; // adding "/ [A-Z]" here breaks it String txt = "HELLO MIRO HOW ARE YOU"; try (GramExp peg = new GramExp(grammar)) { System.out.println(peg.parse(txt)); }
and
final String grammar = "/nlp/\n" + "sent <- goo* name goo*\n" + "name <- 'Miro' \n" + "goo <- [0-9] / [a-zA-Z]/ ' '\n"; // adding "/ [A-Z]" here breaks it String txt = "hello Miro How are you"; try (GramExp peg = new GramExp(grammar)) { System.out.println(peg.parse(txt)); }
The error is: Exception in thread "main" uk.ac.susx.tag.gramexp.GrammarException: Unexpected end of input, expected goo or name (line 1, pos 23)
Exception in thread "main" uk.ac.susx.tag.gramexp.GrammarException: Unexpected end of input, expected goo or name (line 1, pos 23)
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Hi,
I noticed a weird corner case when using uppercase letters in a regex. The following example parses fine:
whereas the next two examples fail. I am only adding support for uppercase letters:
and
The error is:
Exception in thread "main" uk.ac.susx.tag.gramexp.GrammarException: Unexpected end of input, expected goo or name (line 1, pos 23)
The text was updated successfully, but these errors were encountered: