Skip to content

Commit

Permalink
Merge pull request #1082 from spencermountain/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
spencermountain committed Jan 23, 2024
2 parents 015ce33 + 82cf964 commit 1e359f4
Show file tree
Hide file tree
Showing 65 changed files with 720 additions and 393 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -494,6 +494,8 @@ _(match methods use the [match-syntax](https://docs.compromise.cool/compromise-m
- **[.splitOn('')](https://observablehq.com/@spencermountain/compromise-split)** - return a Document with three parts for every match ('splitOn')
- **[.splitBefore('')](https://observablehq.com/@spencermountain/compromise-split)** - partition a phrase before each matching segment
- **[.splitAfter('')](https://observablehq.com/@spencermountain/compromise-split)** - partition a phrase after each matching segment
- **[.join()](https://observablehq.com/@spencermountain/compromise-split)** - merge any neighbouring terms in each match
- **[.joinIf(leftMatch, rightMatch)](https://observablehq.com/@spencermountain/compromise-split)** - merge any neighbouring terms under given conditions
- **[.lookup([])](https://observablehq.com/@spencermountain/compromise-match)** - quick find for an array of string matches
- **[.autoFill()](https://observablehq.com/@spencermountain/compromise-typeahead)** - create type-ahead assumptions on the document

Expand Down
2 changes: 1 addition & 1 deletion builds/compromise.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion builds/one/compromise-one.cjs

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion builds/one/compromise-one.mjs

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion builds/three/compromise-three.cjs

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion builds/three/compromise-three.mjs

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion builds/two/compromise-two.cjs

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion builds/two/compromise-two.mjs

Large diffs are not rendered by default.

11 changes: 11 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,17 @@ While all _Major_ releases should be reviewed, our only _large_ releases are **v
-->

#### 14.11.2 [Jan 2024]

- **[new]** - support for frozen lex in plugin object #1080
- **[fix]** - toggling options in .json()
- **[new]** - .join() and .joinIf() methods
- **[new]** - support freeze in sweep
- **[change]** - internal typescript improvements
- **[fix]** - tagging issues
- **[change]** - @hasEllipses must be following the word
- **[update]** - dependencies

#### 14.11.1 [Jan 2024]

- **[fix]** - missing words in html output (thanks ryan!)
Expand Down
2 changes: 1 addition & 1 deletion data/lexicon/nouns/organizations.js
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ export default [
'the carpenters',
'the guess who',
'the hollies',
'the rolling stones',
// 'the rolling stones',
'the smashing pumpkins',
'the supremes',
'the who',
Expand Down
5 changes: 2 additions & 3 deletions data/lexicon/nouns/singulars.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
// they are all inflected to add their plural form

export default [
'light bulb',

// -ic
'medic',
'ethic',
Expand Down Expand Up @@ -367,7 +365,7 @@ export default [
'row',
'drive thru',
'hash brown',
'living room',
// 'living room',
'seminar',
'variety',
'laboratory',
Expand Down Expand Up @@ -432,4 +430,5 @@ export default [
'brick',
'cannibal',
'video game',
'layer',
]
4 changes: 2 additions & 2 deletions data/lexicon/numbers/units.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ export default [
'quart',
'quarts',
'fl oz',
'fluid ounce',
'fluid ounces',
// 'fluid ounce',
// 'fluid ounces',
'kilometer',
'kilometers',
'meter',
Expand Down
4 changes: 1 addition & 3 deletions data/lexicon/switches/adj-gerund.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// rallying the troops
// her rallying cry
export default [

'absorbing',
'accelerating',
'accompanying',
Expand Down Expand Up @@ -291,7 +290,6 @@ export default [
'yielding',
'accommodating',
'trifling',

'endearing',
// prefixes
]

1 change: 0 additions & 1 deletion data/lexicon/switches/adj-noun.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ export default [
'adult',
'alert',
'alternative',
'animal',
'antarctic',
'arab',
'arctic',
Expand Down
1 change: 1 addition & 0 deletions data/lexicon/switches/noun-verb.js
Original file line number Diff line number Diff line change
Expand Up @@ -925,6 +925,7 @@ export default [
'zip',
'zone',
'zoom',
'lie',
// 'average',
// 'fast',
// 'try',
Expand Down
6 changes: 2 additions & 4 deletions data/lexicon/verbs/infinitives.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
export default [

'abandon',
'abet',
'abide',
Expand Down Expand Up @@ -462,7 +461,6 @@ export default [
'lend',
'lengthen',
'lessen',
'lie',
'like',
'linger',
'liquefy',
Expand Down Expand Up @@ -626,7 +624,7 @@ export default [
'retire',
'retrieve',
'retrofit',
'reup',//'re-up'
'reup', //'re-up'
'revamp',
'revel',
'revere',
Expand Down Expand Up @@ -790,5 +788,5 @@ export default [
'attain',
'pound',
'consume',
'befriend'
'befriend',
]
4 changes: 2 additions & 2 deletions data/lexicon/verbs/participles.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export default [
'drawn',
'dreamt',
'driven',
'drunk',
// 'drunk',
'eaten',
'fallen',
'flown',
Expand Down Expand Up @@ -75,4 +75,4 @@ export default [
'woven',
'written',
'wrung',
]
]
6 changes: 1 addition & 5 deletions data/pairs/Comparative.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
export default [

['angry', 'angrier'],
['bad', 'worse'],
['bald', 'balder'],
Expand Down Expand Up @@ -134,7 +133,6 @@ export default [
['lame', 'lamer'],
['large', 'larger'],
['late', 'later'],
['lay', 'layer'],
['lean', 'leaner'],
['lengthy', 'lengthier'],
['lesser', 'lesser'],
Expand Down Expand Up @@ -308,6 +306,4 @@ export default [
['dim', 'dimmer'],
['', ''],
['', ''],


]
]
46 changes: 23 additions & 23 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"author": "Spencer Kelly <spencermountain@gmail.com> (http://spencermounta.in)",
"name": "compromise",
"description": "modest natural language processing",
"version": "14.11.1",
"version": "14.11.2",
"module": "./src/three.js",
"main": "./src/three.js",
"unpkg": "./builds/compromise.js",
Expand Down Expand Up @@ -102,7 +102,7 @@
"suffix-thumb": "5.0.2"
},
"devDependencies": {
"@rollup/plugin-node-resolve": "15.1.0",
"@rollup/plugin-node-resolve": "15.2.3",
"@rollup/plugin-terser": "0.4.4",
"amble": "1.3.0",
"cross-env": "^7.0.3",
Expand Down
8 changes: 3 additions & 5 deletions plugins/dates/src/api/dates.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@ import find from './find/index.js'
import parseDates from './parse/index.js'
import toJSON from './toJSON.js'


const api = function (View) {

class Dates extends View {
constructor(document, pointer, groups, opts = {}) {
super(document, pointer, groups)
Expand All @@ -14,7 +12,7 @@ const api = function (View) {

get(n) {
let all = []
this.forEach((m) => {
this.forEach(m => {
parseDates(m, this.opts).forEach(res => {
all.push(toJSON(res))
})
Expand All @@ -28,7 +26,7 @@ const api = function (View) {
json(opts = {}) {
return this.map(m => {
let json = m.toView().json(opts)[0] || {}
if (opts && opts.dates !== true) {
if (opts && opts.dates !== false) {
let parsed = parseDates(m, this.opts)
json.dates = toJSON(parsed[0])
}
Expand Down Expand Up @@ -63,4 +61,4 @@ const api = function (View) {
}
}

export default api
export default api
5 changes: 2 additions & 3 deletions plugins/dates/src/api/durations/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import parse from './parse.js'


const addDurations = function (View) {
/** phrases like '2 months', or '2mins' */
class Durations extends View {
Expand All @@ -12,7 +11,7 @@ const addDurations = function (View) {
json(opts = {}) {
return this.map(m => {
let json = m.toView().json(opts)[0] || {}
if (opts && opts.times !== true) {
if (opts && opts.duration !== false) {
json.duration = parse(m)
}
return json
Expand All @@ -21,7 +20,7 @@ const addDurations = function (View) {
/** easy getter for the time */
get(options) {
let arr = []
this.forEach((doc) => {
this.forEach(doc => {
let res = parse(doc)
arr.push(res)
})
Expand Down
Loading

0 comments on commit 1e359f4

Please sign in to comment.