jsRealB Interactive Development Environment (IDE)

One way of testing and developing jsRealB expressions is by using the Javascript console in a browser. But we found it much more convenient to use a command line environment built on top of the node.js Read-Eval-Print Loop.

The system is started by typing

node jsRealB-IDE-repl.js en

which displays a prompt indicating the version and the date the system was compiled, it also loads a default language lexicon and rule set. The second parameter is either en or fr (the default) which indicates the initial realization language.

 ** jsRealB 2.0 (2019-11-25 21:17) Development Environment [help() for info]**
 English lexicon and rules loaded
 jsRealB >

The read-eval-print loop allows the evaluation of any Javascript expression. If the result of the evaluation is an object whose prototype chain contains Constituent (i.e. object instanceof Constituent returns true), then it calls toString() on this value in order to show the realized sentence. If the result is a String, it is displayed without enclosing quotes. Otherwise, the value is shown as it would be in the standard read-eval-print loop using util.inspect(...).

This allows the use of jsRealB functions such as loadEn() or loadFr() for setting the realization language for the following expressions.

The IDE also adds a few commands (i.e. expressions starting with a period) for querying the current lexicon and rule tables. This is useful to find the appropriate information when adding new words with addToLexicon(lemma,information).

These commands also accept a regular expression in place of a specific value, in which case they will return the result for each form that matches the regular expression.