Does Antlr parse multiple tokens from a given text? #4637
Unanswered
AsfarHorani
asked this question in
Q&A
Replies: 2 comments 3 replies
-
|
It's not possible but it's possible to use a parser rule instead: city: Berlin | Paris;
Berlin: 'Berlin';
Paris: 'Paris'; |
Beta Was this translation helpful? Give feedback.
1 reply
-
|
I don't think that ANTLR is the right tool for this task. Just call GPT API. It seems like you are looking to parser freeform text, not a definite structure. You could also use something like spacy in Python. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Given text: I live in Paris but was born in Berlin.
LexerRule:
City: 'Berlin' | 'Paris';
Grammar: City;
Upon running I am only getting Paris and not berlin.
Please help
Beta Was this translation helpful? Give feedback.
All reactions