compromise
Advanced tools
Comparing version 13.1.1 to 13.2.0
@@ -11,2 +11,22 @@ compromise uses semver, and pushes to npm frequently | ||
#### [Unreleased] | ||
-move (some) contractions into tokenizer? | ||
#### 13.2.0 | ||
- deprecate `.money()` and favour overloaded method in compromise-numbers plugin | ||
- add `.percentages()` and `.fractions()` to compromise-numbers plugin | ||
- add `.hasAfter()` and `.hasBefore()` methods | ||
- change handling of slashes | ||
- add `.world()` method to constructor | ||
- add more abbreviations | ||
- fix regex backtracking #739 | ||
- tokenize build: | ||
- - remove conjugation and inflection data | ||
- - remove conjugation and inflection functions | ||
- remove sourcemap from build process (too big) | ||
- improvements to `.numbers().units()` | ||
- fix for linked-list runtime error #744 with contractions | ||
#### 13.1.1 | ||
@@ -13,0 +33,0 @@ |
@@ -5,3 +5,3 @@ { | ||
"description": "modest natural language processing", | ||
"version": "13.1.1", | ||
"version": "13.2.0", | ||
"main": "./builds/compromise.js", | ||
@@ -27,5 +27,6 @@ "unpkg": "./builds/compromise.min.js", | ||
"test:spec": "tape \"./tests/**/*.test.js\" | tap-spec", | ||
"test:perf": "node ./scripts/test/speed/index.js", | ||
"test:types": "ts-node ./scripts/test/types.ts | tap-dancer", | ||
"test:stress": "node ./scripts/test/stress.js", | ||
"perf": "node ./scripts/test/speed/index.js", | ||
"perf:build": "node ./scripts/test/speed/build-speed.js", | ||
"coverage": "node ./scripts/test/coverage.js", | ||
@@ -51,3 +52,4 @@ "coverage:html": "nyc --reporter=html tape \"./tests/**/*.test.js\" | tap-dancer --color always", | ||
"singleQuote": true, | ||
"printWidth": 120 | ||
"printWidth": 120, | ||
"arrowParens": "avoid" | ||
}, | ||
@@ -58,17 +60,17 @@ "dependencies": { | ||
"devDependencies": { | ||
"@babel/core": "7.8.4", | ||
"@babel/preset-env": "7.8.4", | ||
"@rollup/plugin-alias": "3.0.1", | ||
"@rollup/plugin-commonjs": "11.0.2", | ||
"@rollup/plugin-json": "4.0.2", | ||
"@rollup/plugin-node-resolve": "7.1.1", | ||
"amble": "0.0.7", | ||
"@babel/core": "7.9.0", | ||
"@babel/preset-env": "7.9.5", | ||
"@rollup/plugin-alias": "3.1.0", | ||
"@rollup/plugin-commonjs": "11.1.0", | ||
"@rollup/plugin-json": "4.0.3", | ||
"@rollup/plugin-node-resolve": "7.1.3", | ||
"amble": "1.0.0", | ||
"efrt": "2.2.2", | ||
"rollup": "1.31.0", | ||
"rollup-plugin-babel": "4.3.3", | ||
"rollup": "2.7.2", | ||
"rollup-plugin-babel": "4.4.0", | ||
"rollup-plugin-filesize-check": "0.0.1", | ||
"rollup-plugin-terser": "5.2.0", | ||
"shelljs": "0.8.3", | ||
"rollup-plugin-terser": "5.3.0", | ||
"shelljs": "0.8.4", | ||
"tap-dancer": "0.2.0", | ||
"tape": "4.13.0" | ||
"tape": "5.0.0" | ||
}, | ||
@@ -75,0 +77,0 @@ "eslintIgnore": [ |
@@ -340,2 +340,3 @@ <div align="center"> | ||
- **[.version()](https://observablehq.com/@spencermountain/compromise-constructor-methods)** - current semver version of the library | ||
- **[.world()](https://observablehq.com/@spencermountain/compromise-constructor-methods)** - grab all current linguistic data | ||
@@ -450,3 +451,2 @@ ##### Utils | ||
- **[.phoneNumbers()](https://observablehq.com/@spencermountain/compromise-selections)** - things like `'(939) 555-0113'` | ||
- **[.money()](https://observablehq.com/@spencermountain/compromise-values)** - things like `'$2.50'` | ||
- **[.hashTags()](https://observablehq.com/@spencermountain/compromise-selections)** - things like `'#nlp'` | ||
@@ -560,2 +560,3 @@ - **[.emails()](https://observablehq.com/@spencermountain/compromise-selections)** - things like `'hi@compromise.cool'` | ||
- **[.numbers().toLocaleString()](https://observablehq.com/@spencermountain/compromise-values)** - add commas, or nicer formatting for numbers | ||
- **[.money()](https://observablehq.com/@spencermountain/compromise-values)** - things like `'$2.50'` | ||
@@ -673,3 +674,3 @@ ##### Export | ||
// .extend() can be chained | ||
const nlpEx = nlp.extend(ngrams).extend(numbers) | ||
const nlpEx = nlp.extend(ngrams).extend(numbers) | ||
@@ -681,5 +682,7 @@ nlpEx('This is type safe!').ngrams({ min: 1 }) | ||
#### Type-safe Plugins | ||
The `.extend()` function returns an nlp type with updated Document and World types (Phrase, Term and Pool are not currently supported). While the global nlp also recieves the plugin from a runtime perspective; it's type will not be updated - this is a limitation of Typescript. | ||
Typesafe plugins can be created by using the `nlp.Plugin` type: | ||
```ts | ||
@@ -703,4 +706,3 @@ interface myExtendedDoc { | ||
doc.sayHello() | ||
doc.world.hello = "Hello again!" | ||
doc.world.hello = 'Hello again!' | ||
``` | ||
@@ -710,3 +712,3 @@ | ||
* `compromise_1.default is not a function` - This is a problem with your `tsconfig.json` it can be solved by adding `"esModuleInterop": true`. Make sure to run `tsc --init` when starting a new Typescript project. | ||
- `compromise_1.default is not a function` - This is a problem with your `tsconfig.json` it can be solved by adding `"esModuleInterop": true`. Make sure to run `tsc --init` when starting a new Typescript project. | ||
@@ -726,3 +728,3 @@ ### Docs: | ||
- **[Microservice Recipe](https://eventn.com/recipes/text-parsing-with-nlp-compromise)** - by Eventn | ||
- **[Adventure Game Sentence Parsing with Compromise](https://killalldefects.com/2020/02/20/adventure-game-sentence-parsing-with-compromise/) | ||
- \*\*[Adventure Game Sentence Parsing with Compromise](https://killalldefects.com/2020/02/20/adventure-game-sentence-parsing-with-compromise/) | ||
- **[Building Text-Based Games](https://killalldefects.com/2019/09/24/building-text-based-games-with-compromise-nlp/)** - by Matt Eland | ||
@@ -729,0 +731,0 @@ - **[Fun with javascript in BigQuery](https://medium.com/@hoffa/new-in-bigquery-persistent-udfs-c9ea4100fd83#6e09)** - by Felipe Hoffa |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
24450
855
1082417
9