Socket
Socket
Sign inDemoInstall

compromise

Package Overview
Dependencies
Maintainers
2
Versions
169
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

compromise - npm Package Compare versions

Comparing version 9.1.0 to 10.0.0

33

changelog.md
`compromise` uses semver, with occasional releases to npm and bower.
here, 'Major' is considered an api change, while 'Minor' is considered a performance change.
### v10
- cleanup & rename some `.value()` methods
- change lumping behaviour of lexicon terms with multiple words
- keep more former tags after a term replace method
- new `.random()` method
- new `.lessThan()`, `.greaterThan()`, `.equalTo()` methods
- new prefix/suffix/infix matches with `_ffix` syntax
- `tag()` supports a sequence of tags for a sequence of terms
- .match 'range' queries now use a real match - `#Adverb{2,4}`
- new `.before()` and `.after()` match methods
- removes `.lexicon()` method for many-lexicons concept
- changes params of `.replaceWith()` method to a 'keyTags' boolean
- improved .debug() and logging on clientside
### v.9  
### v9  
* 9.0.0

@@ -15,3 +28,3 @@ - rename `Term.tag` object to `Term.tags` so the `.tag()` method can work throughout more-consistently

### v.8  
### v8  
* 8.0.0 - less-ambitious date-parsing of nl-date forms

@@ -22,7 +35,7 @@ * - filesize reduction using [efrt](https://github.com/nlp-compromise/efrt) data structure (254k -> 214k)

### v.7   :postal_horn:
### v7   :postal_horn:
* 7.0.0 - weee! [big change!](https://github.com/nlp-compromise/compromise/wiki/v7-Upgrade,-welcome) *npm package rename*
* 7.0.15 - fix for IE9
### v.6  
### v6  
* 6.5.0 - builds now using browserify + derequire()

@@ -33,3 +46,3 @@ * 6.4.0 - re-written term-lumper logic

### v.5  
### v5  
* 5.2.0 - airport codes support, helper methods for specific POS

@@ -39,3 +52,3 @@ * 5.1.0 - newlines split sentences

### v.4  
### v4  
* 4.12.0 - more-sensible responses for invalid, non-string inputs

@@ -53,3 +66,3 @@ * 4.11.0 - 14 PRs, with fixes for currencies, pluralization, conjugation

### v.3   **(Breaking)**
### v3   **(Breaking)**
* 3.0.2 - Statement & Question classes

@@ -59,3 +72,3 @@ * v3.0.0 - Feb 2016

### v.2
### v2
* v2.0.0 - Nov 2015   **(Breaking)**

@@ -75,3 +88,3 @@ * es6 classes, babel building

### v.1
### v1
* v1.1.0 - May 2015

@@ -84,3 +97,3 @@ smarter handling of ambiguous contractions ("he's" -> ["he is", "he has"])

### v.0
### v0

@@ -87,0 +100,0 @@ * v0.5.2 - May 2015

@@ -72,2 +72,7 @@ 'use strict';

example: 'nlp(\'sex cauldron? I thought they closed that place down.\').flatten().length()\n//1'
},
random: {
desc: 'sample a random section of n matches',
returns: 'Text',
example: 'nlp(\'one two three four\').terms().random(2).out(\'array\')\n//[\'four\',\'one\']'
}

@@ -137,8 +142,8 @@ },

replaceWith: {
desc: 'turn the current selection into something else. Essentially just delete() -> insertAt().',
desc: 'turn the current selection into something else. Essentially just delete() -> insertAt(). The second param says whether to keep original tags around.',
returns: 'Text',
example: 'nlp(\'it was the worst of times\').match(\'worst\').replaceWith(\'blurst\').all().out()\n//it was the blurst of times'
example: 'nlp(\'it was the worst of times\').match(\'worst\').replaceWith(\'blurst\', true).all().out()\n//it was the blurst of times'
},
replace: {
desc: 'turn a new selection into something else. Essentially just match() -> delete() -> insertAt().',
desc: 'turn a new selection into something else. Essentially just match() -> delete() -> insertAt(). Third optional param keeps original tags around.',
returns: 'Text',

@@ -179,2 +184,12 @@ example: 'nlp(\'trust me folks, big league.\').replace(\'big league\',\'bigly\').all().out()\n//trust me folks, bigly.'

example: 'nlp(\'I am the very model of a modern Major-General\').has(\'#Pronoun\')\n//true,'
},
before: {
desc: 'find a match, and return everything infront of it',
returns: 'Text',
example: 'nlp(\'one two three four five\').before(\'three\').out()\n//one two'
},
after: {
desc: 'find a match, and return everything following of it',
returns: 'Text',
example: 'nlp(\'one two three four five\').after(\'three\').out()\n//four five'
}

@@ -181,0 +196,0 @@ },

@@ -19,11 +19,11 @@ 'use strict';

},
toTextValue: {
toText: {
desc: 'turn a number like `5,500` into it\'s textual form, like `five thousand five hundred`',
returns: 'Text',
example: 'nlp(\'10 things i hate about you\').values().toTextValue().all().out()\n//ten things i hate about you'
example: 'nlp(\'10 things i hate about you\').values().toText().all().out()\n//ten things i hate about you'
},
toNiceNumber: {
toNice: {
desc: 'turn a number into numerical form, but with nice commas, like `5,500`',
returns: 'Text',
example: 'nlp(\'five hundred sixty two thousand, four hundred and seven\').values().toTextValue().all().out()\n//\'562,407\''
example: 'nlp(\'five hundred sixty two thousand, four hundred and seven\').values().toNice().all().out()\n//\'562,407\''
},

@@ -44,3 +44,18 @@ toCardinal: {

example: 'nlp(\'at the seven eleven\').values().numbers()\n// [7, 11]'
},
greaterThan: {
desc: 'return only the values larger than a given value',
returns: 'Text',
example: 'nlp(\'seven peaches weigh ten kilograms\').values().greaterThan(7).out(\'array\')\n// [\'10\']'
},
lessThan: {
desc: 'return only the values smaller than a given value',
returns: 'Text',
example: 'nlp(\'he is 7 years old\').values().greaterThan(\'five\').out(\'array\')\n// [\'7\']'
},
isEqual: {
desc: 'return only the values equal to a given value',
returns: 'Text',
example: 'nlp(\'it\'s his 7th birthday\').values().isEqual(7).out(\'array\')\n// [\'7th\']'
}
};

@@ -5,3 +5,3 @@ {

"description": "natural language processing in the browser",
"version": "9.1.0",
"version": "10.0.0",
"main": "./builds/compromise.js",

@@ -8,0 +8,0 @@ "repository": {

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 too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc