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 12.0.0-rc2 to 12.0.0

LICENSE

5

changelog.md

@@ -9,5 +9,4 @@ compromise uses semver, and pushes to npm frequently

### v12
- drop support for `regex` and `patterns` in plugins
- camelCase() now removes punctuation between terms
### v12   :postal_horn:
- [see Release Notes](https://github.com/spencermountain/compromise/wiki/v12-Release-Notes)

@@ -14,0 +13,0 @@ ### v11

8

package.json

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

"description": "natural language processing in the browser",
"version": "12.0.0-rc2",
"version": "12.0.0",
"main": "./builds/compromise.js",

@@ -50,7 +50,7 @@ "unpkg": "./builds/compromise.min.js",

"devDependencies": {
"@babel/core": "7.6.4",
"@babel/preset-env": "7.6.3",
"@babel/core": "7.7.4",
"@babel/preset-env": "7.7.4",
"amble": "0.0.7",
"efrt": "2.2.1",
"rollup": "1.26.3",
"rollup": "1.27.5",
"rollup-plugin-babel": "4.3.3",

@@ -57,0 +57,0 @@ "rollup-plugin-commonjs": "10.1.0",

@@ -52,3 +52,3 @@ <div align="center">

<code>
Welcome to v12! - <a href="">Release Notes here 👍</a>
Welcome to v12! - <a href="https://github.com/spencermountain/compromise/wiki/v12-Release-Notes">Release Notes here 👍</a>
</code>

@@ -145,4 +145,2 @@ </div>

```js
nlp.extend(require('compromise-entities'))
let doc = nlp(buddyHolly)

@@ -207,10 +205,10 @@ doc

<script src="https://unpkg.com/compromise"></script>
<script src="https://unpkg.com/compromise-numbers"></script>
<script>
var doc = nlp('dinosaur')
var str = doc
.nouns()
.toPlural()
.text()
console.log(str)
// 'dinosaurs'
nlp.extend(compromiseNumbers)
var doc = nlp('two bottles of beer')
doc.numbers().minus(1)
document.body.innerHTML = doc.text()
// 'one bottle of beer'
</script>

@@ -326,3 +324,2 @@ ```

- **[.extend()](https://observablehq.com/@spencermountain/compromise-constructor-methods)** - mix in a compromise-plugin
- **[.clone()](https://observablehq.com/@spencermountain/compromise-constructor-methods)** - make a deep-copy of the library state
- **[.load()](https://observablehq.com/@spencermountain/compromise-constructor-methods)** - re-generate a Doc object from .export() results

@@ -533,2 +530,3 @@ - **[.verbose()](https://observablehq.com/@spencermountain/compromise-constructor-methods)** - log our decision-making for debugging

- **[.numbers().json()](https://observablehq.com/@spencermountain/compromise-values)** - overloaded output with number metadata
- **[.numbers().units()](https://observablehq.com/@spencermountain/compromise-values)** - grab 'kilos' from `25 kilos'`
- **[.numbers().money()](https://observablehq.com/@spencermountain/compromise-values)** - things like `'$2.50'`

@@ -540,2 +538,3 @@ - **[.numbers().fractions()](https://observablehq.com/@spencermountain/compromise-values)** - things like `1/3rd`

- **[.numbers().toCardinal()](https://observablehq.com/@spencermountain/compromise-values)** - convert number to `five` or `5`
- **[.numbers().set(n)](https://observablehq.com/@spencermountain/compromise-values)** - set number to n
- **[.numbers().add(n)](https://observablehq.com/@spencermountain/compromise-values)** - increase number by n

@@ -600,9 +599,8 @@ - **[.numbers().subtract(n)](https://observablehq.com/@spencermountain/compromise-values)** - decrease number by n

- **[.sentences().subjects()](#)** - return the main noun of each sentence
- **[.sentences().toPastTense()](#)** -
- **[.sentences().toPresentTense()](#)** -
- **[.sentences().toFutureTense()](#)** -
- **[.sentences().toContinuous()](#)** -
- **[.sentences().toNegative()](#)** -
- **[.sentences().toPositive()](#)** -
- **[.sentences().isPassive()](#)** -
- **[.sentences().toPastTense()](#)** - `he walks` -> `he walked`
- **[.sentences().toPresentTense()](#)** - `he walked` -> `he walks`
- **[.sentences().toFutureTense()](#)** -- `he walks` -> `he will walk`
- **[.sentences().toNegative()](#)** - - `he walks` -> `he didn't walk`
- **[.sentences().toPositive()](#)** - `he doesn't walk` -> `he walks`
- **[.sentences().isPassive()](#)** - return only sentences with a passive-voice
- **[.sentences().isQuestion()](#)** - return questions with a `?`

@@ -613,6 +611,6 @@ - **[.sentences().isExclamation()](#)** - return sentences with a `!`

- **[.sentences().append()](#)** - smarter append that repairs sentence punctuation
- **[.sentences().toExclamation()](#)** -
- **[.sentences().toQuestion()](#)** -
- **[.sentences().toStatement()](#)** -
-
- **[.sentences().toExclamation()](#)** - end sentence with a `!`
- **[.sentences().toQuestion()](#)** - end sentence with a `?`
- **[.sentences().toStatement()](#)** - end sentence with a `.`
<!-- - **[.sentences().toContinuous()](#)** - -->

@@ -619,0 +617,0 @@ ##### Syllables

@@ -11,4 +11,2 @@ export as namespace nlp

export function extend(plugin: any): Document
/** make a deep-copy of the library state */
export function clone(): Document
/** re-generate a Doc object from .json() results */

@@ -213,2 +211,4 @@ export function load(json: any): Document

// Subsets
/** alias for .all(), until plugin overloading */
sentences(): Document
/** return any multi-word terms, like "didn't" */

@@ -215,0 +215,0 @@ contractions(n?: Number): Document

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

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