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
- Host: GitHub
- URL: https://github.com/christianp/grammars-for-informal-notation
- Owner: christianp
- License: apache-2.0
- Created: 2016-09-22T14:56:17.000Z (over 8 years ago)
- Default Branch: gh-pages
- Last Pushed: 2017-02-27T15:56:53.000Z (about 8 years ago)
- Last Synced: 2024-12-26T11:27:47.740Z (4 months ago)
- Topics: computer-algebra, grammar, javascript, numbas, parsing, peg
- Language: JavaScript
- Size: 349 KB
- Stars: 0
- Watchers: 4
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
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.