Codementor Events

Rita.JS a small tutorial on RiGrammers.

Published Jan 29, 2022
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 HypothesisHypothesis 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 SHORTEQSHORTEQ
<ASSUMPTION>: let VARVAR be a <OBJECT>
<ASSUMPTION>: <ASSUME> we are given a <OBJECT> VARVAR
<ASSUMPTION>: let SHORTEQSHORTEQ be arbitrary

<ASSERTION>: <COND>
<ASSERTION>: SHORTEQSHORTEQ
<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>

Discover and read more posts from anil kumar bheemaiah
get started
post commentsBe the first to share your opinion
Show more replies