Search code examples
c#.netparsingparser-generatorparse-forest

Does a C# parser generator that returns parse forests for ambiguous statements exist?


I would like to explore the use of formal language processing in the context of natural languages. To do so, I am searching for a parser generator that is robust to ambiguity in the sense that it won't denote EBNF as invalid when it multiple productions can be used to produce the same string. Furthermore, the standard way of handling redundancy is by returning parse forests instead of parse trees.

I am NOT asking what the best tool is, but only if there are tools that can be obtained for C#. And if there are, where can I find them.

It does not matter if the tool is open-source or proprietary.

The answer will be awarded to the longest list of unique (not mentioned earlier) tools which satisfy the required constraints on the parser returned by the parser generator.

Please help me explore parse forests.


Solution

  • You may find an implementation of Earley's Algorithm that does what you want, e.g. https://github.com/coonsta/earley

    My own natural language engine (nlp.abodit.com) is based on an algorithm similar to Earley's.