A human phrase recognition process

pegram is an attempt to develop human phrase recognitions using PEG grammar knowledge bases and the PEG javascript parser


  • Detect most french grammar terms: nominal and vertical groups, prepositions, complements, some adjectives and interjections.
  • Useful logging console with ANSI colors
  • pegram can load multiple grammar each other as a result of a knowledge base and a strategy to serve the JSON grammar

Getting started

If you have already Node.js installed, just download the master branch, go to the unzipped directory and execute pegram :

node pegram.js

You can now go to http://localhost:8000, and test the application. It will read user input stream and decode string into a JSON grammar tree (see the javascript console). Just give it a try !


Here are the upcoming plans for pegram. If you want to see other stuff, please contact me on the enhancement section or just make a pull request.

  • Add a dictionary API to search for complex word definitions, recognition will be more accurate.
  • Add rules for advanced recognition of propositions relations ('subordonnée, complétive, etc...')
  • Add rules for common verb conjugation in order to detect properly most used actions
  • English support