jschanker / text2code

Natural language processor that compiles pseudocode to Blockly code blocks
5 stars 1 forks source link

text2code

Natural language processor that compiles pseudocode to Blockly code blocks.

Blockly base code from: https://github.com/google/blockly/

Future of app : Voice ==> Text (Pseudocode) ==> Blockly code blocks ==> Python, JavaScript, etc.

How to use and currently supported conversions:

Some variations of these forms are also possible as can be seen by examining the statementPartSchema object in parser.js. For example, consider the following from the statementGeneral category:

A syntactically valid form consists of any match in the for token array ("for each", "for every", "go through every", "go through each", "go through", "every", "for all", "all", "each", and "for") followed by one or more spaces and any match of the regular expression for the variable token (/[A-Za-z_]\w*/) (i.e., a letter or underscore followed by 0 or more alphanumeric or underscore characters) followed by the lessThan possibilities of "is less than", "less than", or "<" followed by one or more any of the valid forms from the expressionNumerical category followed by a comma and then any of the valid statement forms from the statementGeneral category:

As an implementation note, tokens should be categorized and processed differently in a future version. Currently, the program tries to match each word (or regular expression) in the order that it appears.