If you write a parser as a Ruby object that consumes its method_missing arguments, I guess you could just do full blown NLP or define any context-free grammar as a DSL?
RT @dmitrytsepelev@twitter.com
Check out my experimental gem for creating natural–ish DSLs with Ruby 🙂 Link: https://github.com/DmitryTsepelev/natural_dsl
🐦🔗: https://twitter.com/dmitrytsepelev/status/1554407425482047488
An object with a BNF grammar and an evaluation function, which feeds its method_missing to a shift/reduce parser and returns itself, except when the full input is consumed, when it passes the resulting tree to the evaluation function, and returns the result.
You could probably define a function which within its block argumentt overrides the kernel method_missing, so sentences don't need a set starting word.