Rita.JS a small tutorial on RiGrammers.
Rita.JS is a JS library in the processor paradigm to write markov field and CFG grammers for computational literature.
Using the Markov fields is very easy, you just train the markov model with example text and generate new sentences from it, while the CFGs take much more creativity.
As an exercise in humor, I tried a simple grammer as a YAML, for an assertion and assumption content generator for a math paper, the grammer is from scigen.in, scigen generates random papers with nonsense content, which can be fun to read.
Here is the YAML file of the grammer. We add templates, for template substitution using Wolfram Cloud.
<start>: <ASSUMPTION>
<ASSUMPTION>: Then <ASSERTION>
<ASSUMPTION>: <ASSUMPTION> Then <ASSERTION>
<ASSUMPTION>: <ASSUMPTION> Further, <ASSUMPTION> Then <ASSERTION>
<COND>: the hypothesis holds
<COND> :<FAMOUSPOS> condition is satisfied
<COND> :<FAMOUSPOS> criterion applies
<hh>: <ASSUME>
<ASSUME>: suppose
<ASSUME>: let us suppose
<ASSUME>: let us <ASSUME>
<ASSUMPTION>: <ASSUME> <ASSERTION>
<ASSUMPTION>: let
<ASSUMPTION>: let be a <OBJECT>
<ASSUMPTION>: <ASSUME> we are given a <OBJECT>
<ASSUMPTION>: let be arbitrary
<ASSERTION>: <COND>
<ASSERTION>:
<ASSERTION>: every <OBJECT> is <PROPPHRASE>
<ASSERTION>: there exists a <PROPPHRASE> <OBJECT>
<ASSERTION>: <INLINEEQ>
<ASSERTION>: <DISPEQ>
<ASSERTION>: <FAMOUSPOS> conjecture is <BOOL>
<ASSERTION>: <FAMOUSPOS> conjecture is <BOOL> in the context of <OBJECT>