rita 3.0.27 → 3.0.29

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/rita.js CHANGED
@@ -42242,10 +42242,11 @@ var _RiMarkov = class _RiMarkov {
42242
42242
  }
42243
42243
  const nexts = tn.childNodes();
42244
42244
  for (let i = 0; i < nexts.length; i++) {
42245
- let atest = pre.slice(0);
42246
- atest.push(nexts[i].token, ...post);
42247
- if (this._pathTo(atest))
42248
- result.push(nexts[i].token);
42245
+ let atest = pre.slice(0), next = nexts[i];
42246
+ atest.push(next.token, ...post);
42247
+ if (this._pathTo(atest)) {
42248
+ result.push(next.token);
42249
+ }
42249
42250
  }
42250
42251
  } else {
42251
42252
  const pr = this.probabilities(pre);
@@ -42580,10 +42581,11 @@ var RiTa = class _RiTa {
42580
42581
  * Create a RiTa grammar instance
42581
42582
  * @param {object} [rules] - the rules of the grammar
42582
42583
  * @param {object} [context] - the context of the grammar
42584
+ * @param {object} [options] - options for the grammar
42583
42585
  * @returns {RiGrammar} - a new RiGrammar instance
42584
42586
  */
42585
- static grammar(rules, context) {
42586
- return new RiGrammar(rules, context);
42587
+ static grammar(rules, context, options) {
42588
+ return new RiGrammar(rules, context, { ...options, RiTa: _RiTa });
42587
42589
  }
42588
42590
  /**
42589
42591
  * Add a transform function to the RiScript parser
@@ -42624,7 +42626,7 @@ var RiTa = class _RiTa {
42624
42626
  * @returns {string} the result of the evaluation
42625
42627
  */
42626
42628
  static evaluate(script, context, options) {
42627
- return _RiTa.riscript.evaluate(script, context, options);
42629
+ return _RiTa.riscript.evaluate(script, context, { ...options });
42628
42630
  }
42629
42631
  /**
42630
42632
  * Creates a new RiMarkov object
@@ -43236,7 +43238,7 @@ markov_default.parent = RiTa;
43236
43238
  stemmer_default.tokenizer = RiTa.tokenizer;
43237
43239
  RiTa.SILENT = false;
43238
43240
  RiTa.SILENCE_LTS = false;
43239
- RiTa.VERSION = "3.0.27";
43241
+ RiTa.VERSION = "3.0.29";
43240
43242
  RiTa.FIRST = 1;
43241
43243
  RiTa.SECOND = 2;
43242
43244
  RiTa.THIRD = 3;