rita 3.1.1 → 3.1.2

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/README.md CHANGED
@@ -1,3 +1,6 @@
1
+ ![ritajs](pen.jpg)
2
+
3
+
1
4
  <a href="https://github.com/dhowe/rjs3/actions"><img src="https://github.com/dhowe/rjs3/actions/workflows/node.js.yml/badge.svg" alt="ci tests"></a> <a href="https://www.npmjs.com/package/rita"><img src="https://img.shields.io/npm/v/rita.svg" alt="npm version"></a> <a href="https://www.gnu.org/licenses/gpl-3.0.en.html"><img src="https://img.shields.io/badge/license-GPL-orange.svg" alt="license"></a>
2
5
 
3
6
 
@@ -22,6 +25,7 @@ Note: version 3.0 contains breaking changes -- please check the [release notes](
22
25
  * For [node](#with-nodejs-and-npm): `$ npm install rita`
23
26
  ```let { RiTa } = require('rita');```
24
27
  * For [browsers](#a-simple-browser-sketch): ```<script src="https://unpkg.com/rita"></script>```
28
+ * For [p5.js](#with-p5js): ```<script src="https://unpkg.com/rita"></script>```
25
29
  * For [developers](#developing)
26
30
 
27
31
 
package/dist/rita.cjs CHANGED
@@ -1444,11 +1444,10 @@ var Conjugator = class {
1444
1444
  });
1445
1445
  this.RiTa = parent;
1446
1446
  this._reset();
1447
- this.RiTa.search({ pos: "v", limit: -1, minLength: -1 }).then((res) => {
1448
- this.allVerbs = res;
1449
- this.verbsEndingInE = res.filter((v) => v.endsWith("e"));
1450
- this.verbsEndingInDouble = res.filter((v) => /([^])\1$/.test(v));
1451
- });
1447
+ let data = this.RiTa.lexicon.data;
1448
+ this.allVerbs = Object.keys(data).filter((word) => data[word][1].split(" ").includes("vb"));
1449
+ this.verbsEndingInE = this.allVerbs.filter((v) => v.endsWith("e"));
1450
+ this.verbsEndingInDouble = this.allVerbs.filter((v) => /([^])\1$/.test(v));
1452
1451
  }
1453
1452
  // TODO: add handling of past tense modals.
1454
1453
  conjugate(verb, args) {
@@ -27402,7 +27401,7 @@ var Lexicon = class {
27402
27401
  }
27403
27402
  regex = opts.regex;
27404
27403
  if (typeof regex === "string") {
27405
- if (opts && opts.type === "stresses") {
27404
+ if (opts && /^stress(es)?$/.test(opts.type)) {
27406
27405
  if (/^\^?[01]+\$?$/.test(regex)) {
27407
27406
  regex = regex.replace(/([01])(?=([01]))/g, "$1/");
27408
27407
  }
@@ -43238,7 +43237,7 @@ markov_default.parent = RiTa;
43238
43237
  stemmer_default.tokenizer = RiTa.tokenizer;
43239
43238
  RiTa.SILENT = false;
43240
43239
  RiTa.SILENCE_LTS = false;
43241
- RiTa.VERSION = "3.1.1";
43240
+ RiTa.VERSION = "3.1.2";
43242
43241
  RiTa.FIRST = 1;
43243
43242
  RiTa.SECOND = 2;
43244
43243
  RiTa.THIRD = 3;