Skip to content

Commit

Permalink
Merge pull request #798 from spencermountain/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
spencermountain authored Dec 18, 2020
2 parents af3210f + 0704b54 commit dc2bf44
Show file tree
Hide file tree
Showing 330 changed files with 479,412 additions and 15,056 deletions.
2 changes: 1 addition & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"extends": [],
"rules": {
"semi": ["warn", "never"],
"indent": ["error", 2],
"indent": ["error", 2, { "SwitchCase": 1 }],
"spaced-comment": 0,
"no-cond-assign": 2,
"no-var": 1,
Expand Down
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -529,6 +529,7 @@ These are some helpful extensions:

- **[.numbers()](https://observablehq.com/@spencermountain/compromise-values)** - grab all written and numeric values
- **[.numbers().json()](https://observablehq.com/@spencermountain/compromise-values)** - overloaded output with number metadata
- **[.numbers().get()](https://observablehq.com/@spencermountain/compromise-values)** - retrieve the parsed number(s)
- **[.numbers().units()](https://observablehq.com/@spencermountain/compromise-values)** - grab 'kilos' from `25 kilos'`
- **[.numbers().fractions()](https://observablehq.com/@spencermountain/compromise-values)** - things like `1/3rd`
- **[.numbers().toText()](https://observablehq.com/@spencermountain/compromise-values)** - convert number to `five` or `fifth`
Expand All @@ -548,6 +549,11 @@ These are some helpful extensions:
- **[.numbers().isCardinal()](https://observablehq.com/@spencermountain/compromise-values)** - return only cardinal numbers
- **[.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'`
- **[.money().get()](https://observablehq.com/@spencermountain/compromise-values)** - retrieve the parsed amount(s) of money
- **[.money().json()](https://observablehq.com/@spencermountain/compromise-values)** - currency + number info
- **[.money().currency()](https://observablehq.com/@spencermountain/compromise-values)** - which currency the money is in
- **[.fractions()](https://observablehq.com/@spencermountain/compromise-values)** - like '2/3rds'
- **[.percentages()](https://observablehq.com/@spencermountain/compromise-values)** - like '2.5%'

##### Export

Expand Down Expand Up @@ -632,6 +638,12 @@ this plugin creates a wrapper around the default sentence objects.
- **[.sentences().toStatement()](https://observablehq.com/@spencermountain/compromise-sentences)** - end sentence with a `.`
<!-- - **[.sentences().toContinuous()](#)** - -->

##### Strict-match

`npm install compromise-strict`

- **[.strictMatch()](https://observablehq.com/@spencermountain/compromise-strict)** - perform a compromise match using a formal parser

##### Syllables

`npm install compromise-syllables`
Expand Down
40 changes: 0 additions & 40 deletions bugs.js

This file was deleted.

67 changes: 67 additions & 0 deletions bugs.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@

// ---Nov 24th number agreement issue--
```js
let doc = nlp('7th hour').debug()
let num = doc.numbers()
num.toCardinal(false)
doc.debug()
//7 hours
```

// ---Nov 23rd tagger--
```js
let doc = nlp(`the latter a dire security threat`)
let doc = nlp(`My first thought was to push it away, he said.`)
let doc = nlp(`and too many of the rich made their money`)
let doc = nlp(`Puerto Rico only (I need historical inflation data)`)
let doc = nlp(`blows it up`)
let doc = nlp(`20 people, including many children`)
let doc = nlp(` with heads and arms rolling around`)
```
// --- verbphrase conjugation issues---
```js
let doc = nlp('i am being driven')
let doc = nlp('i should be driven')
let doc = nlp('i should have been driven')
doc.verbs().toParticiple()
doc.verbs().toPastTense()
doc.debug()
console.log(doc.verbs(0).conjugate())
doc.sentences().toFutureTense().debug()

console.log(nlp('next week').dates().json())
nlp('you are John, Lisa, Fred').match('#FirstName{1,2}').debug()

let doc = nlp('i could study').debug()
doc.verbs().toParticiple()
doc.sentences().toPastTense()
console.log(doc.text())
// i thought he really could have.

let doc = nlp('i did really walk')
doc.sentences().toPresentTense()
console.log(doc.text())
```

---- tagger issues ---
```js
nlp('lowered according').debug()
nlp('it bristles outwards, brushlike.').debug()
nlp('red-shouldered').debug()
nlp('age of it').debug()
nlp('so well that').debug()
nlp('is off-white').debug()
nlp('polyunsaturated').debug()
nlp('favoured treat').debug()
```

---- gerund uses ---
```
Snowboarding is a winter sport. [snowboarding = subject]
I love snowboarding. [snowboarding = object ]
I am excited by snowboarding. [snowboarding = object of a preposition]
One popular sport is snowboarding. [snowboarding = subject complement]
Right now, the athlete is snowboarding. [is snowboarding = present continuous]
He was snowboarding yesterday afternoon. [was snowboarding = past continuous]
Tomorrow, my friends and I are going to be snowboarding. [are going to be snowboarding = future
```
2 changes: 1 addition & 1 deletion builds/compromise-tokenize.js

Large diffs are not rendered by default.

Loading

0 comments on commit dc2bf44

Please sign in to comment.