An open API service indexing awesome lists of open source software.

https://github.com/christianp/grammars-for-informal-notation

A customisable parsing expression grammar for Numbas' JME
https://github.com/christianp/grammars-for-informal-notation

computer-algebra grammar javascript numbas parsing peg

Last synced: 2 months ago
JSON representation

A customisable parsing expression grammar for Numbas' JME

Awesome Lists containing this project

README

        

We're working on a system which can parse student's ambiguous mathematical notation.

1. Offer suggestions or decided what is meant based on context.
2. Flexible parsing rules based on commonly used mathematical contexts.
3. Output the resulting parse-trees in a variety of languages, e.g. LaTeX, Maxima.

The longer term goal of this work is to use the resulting parser in an online assessment system with students.

## To run the tests

* Install [npm](https://www.npmjs.com/)
* Install nearley: `npm install nearley`
* Compile the grammar to JavaScript: `make jme-nearley.js`
* Now [test.html](test.html) should work.

## Parsing libraries

* [PEGjs](https://pegjs.org/) - creates simple, unambiguous parsers.
* [Nearley](http://nearley.js.org/) - creates very versatile parsers, and returns multiple results for ambiguous grammars.