-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
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
Convert natural language parser to BNF #9
Comments
What is BNF? |
https://en.wikipedia.org/wiki/Backus%E2%80%93Naur_form It's how the EDTF is specified. But we could use the same technique for describing common forms of natural language descriptions of dates, rather than the handmade python approach. In other words, if we can derive the meaning of a date described in natural language using a pyparsing grammar, then the description is more maintainable/customisable/pluggable for different use cases or languages. |
If you're interested, you can look at some of the work I've done on expressing this as a formal grammar in Ruby, at https://github.com/arttracks/cultural_dates. I'm hoping to port the grammar over to JS in the near future, as well, and might need it (or something similar) in Python. |
thanks for answer the question. |
@workergnome I know this comment is from ages ago ...
... but could you share the status? And/or point me to the right places in your ruby & js code? (I maybe found some of it, want to make sure I'm looking at the right things.) Did you ever generalize or port to python? If not, what do you think it would take to do that? |
Sure thing! The date logic is embedded in the https://github.com/workergnome/arttracks-js repo (in Javascript), and there's a demo of it here: https://date-calculator.davidnewbury.com. The code for the demo is https://github.com/workergnome/date-calculator. Never did anything in Python with it, unfortunately. If you have questions, shoot me an email at [email protected]? |
@workergnome thanks for the response! Will follow up by email when I get the chance |
The current natural language parser is hand-baked in Python. It can probably be translated to BNF, to do more advanced, easier-to-customise and easier-to-translate parsing.
The text was updated successfully, but these errors were encountered: