A robust and efficient implementation of the Earley parsing algorithm in C#. This parser handles context-free grammars and provides detailed parse trees for natural language processing, programming language parsing, and other text analysis tasks.
The Earley algorithm is a powerful chart parsing technique that can process any context-free grammar, including ambiguous grammars, without the need for grammar transformations. This implementation offers:
- Support for any context-free grammar (CFG)
- Efficient parsing with O(n³) time complexity in the worst case
- Detailed parse tree construction
- Ambiguity handling
Generated from XML code documentation: here
Install-Package EarleyParser
dotnet add package EarleyParser
using EarleyParser;
// Define a simple grammar
// Create a parser with the grammar
// Parse a sentence
This project is licensed under the MIT License - see the LICENSE file for details.
- Jay Earley, for developing the original algorithm