Skip to content

Commit

Permalink
Merge pull request #952 from spencermountain/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
spencermountain authored Aug 26, 2022
2 parents 290a65d + e1981cc commit 7098492
Show file tree
Hide file tree
Showing 46 changed files with 637 additions and 399 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -629,7 +629,7 @@ _(these methods are on the main `nlp` object)_
- **[.verbs().toFutureTense()](https://observablehq.com/@spencermountain/verbs)** - `'walked' → 'will walk'`
- **[.verbs().toInfinitive()](https://observablehq.com/@spencermountain/verbs)** - `'walks' → 'walk'`
- **[.verbs().toGerund()](https://observablehq.com/@spencermountain/verbs)** - `'walks' → 'walking'`
- **[.verbs().conjugate()](https://observablehq.com/@spencermountain/verbs)** - return all forms of these verbs
- **[.verbs().conjugate()](https://observablehq.com/@spencermountain/verbs)** - return all conjugations of these verbs
- **[.verbs().isNegative()](https://observablehq.com/@spencermountain/verbs)** - return verbs with 'not', 'never' or 'no'
- **[.verbs().isPositive()](https://observablehq.com/@spencermountain/verbs)** - only verbs without 'not', 'never' or 'no'
- **[.verbs().toNegative()](https://observablehq.com/@spencermountain/verbs)** - `'went' → 'did not go'`
Expand Down Expand Up @@ -689,6 +689,7 @@ _(these methods are on the main `nlp` object)_
##### Adjectives
- **[.adjectives()](https://observablehq.com/@spencermountain/compromise-selections)** - things like `'quick'`
- **[.adjectives().json()](https://observablehq.com/@spencermountain/compromise-selections)** - get adjective metadata
- **[.adjectives().conjugate()](https://observablehq.com/@spencermountain/compromise-selections)** - return all inflections of these adjectives
- **[.adjectives().adverbs()](https://observablehq.com/@spencermountain/compromise-selections)** - get adverbs describing this adjective
- **[.adjectives().toComparative()](https://observablehq.com/@spencermountain/compromise-selections)** - 'quick' -> 'quicker'
- **[.adjectives().toSuperlative()](https://observablehq.com/@spencermountain/compromise-selections)** - 'quick' -> 'quickest'
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.

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

<!-- #### 14.5.0 [Unreleased]
-->

#### 14.5.0 [August 2022]
- **[fix]** - possible runtime error in setTag method
- **[change]** - make #Honorific always a #Person #951
- **[new]** - manually change conjugations/inflections from plugin #949
- **[new]** - `.adjectives().conjugate()` method
- **[update]** - dependencies

#### 14.4.5 [August 2022]
- **[fix]** - fix logic for greedy-negative matches - #936
- **[fix]** - fix tagging for 3-digit year iso dates - #868
Expand Down
20 changes: 20 additions & 0 deletions data/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
hello!

here is the data compressed and compiled into the word models that compromise uses to understand text.

there are some things to note:

1. run `npm run pack` after making a change, to see changes appear.

2. lexicon words are lowercased and compressed with [efrt](https://github.com/spencermountain/efrt), some characters are reserved -`[0-9,;!:|¦]`

3. be careful adding ambiguous words - 'ray' should not be a #Person - it's a better fit for `./switches/person-date.js`

4. many word-lists have conjugations automatically applied to them - #Singular words are pluralized, etc.


the lexicon output data can be found in `./src/2-two/preTagger/model/lexicon/_data.js`

and the word-conjugation data can be found in `./src/2-two/preTagger/model/models/_data.js`

for more information, see the [compromise-lexicon docs](https://observablehq.com/@spencermountain/compromise-lexicon).
1 change: 0 additions & 1 deletion data/lexicon/adjectives/adjectives.js
Original file line number Diff line number Diff line change
Expand Up @@ -620,7 +620,6 @@ export default [
'contradictory',
'satisfactory',

'premier',
'skilled',
'antique',
'dependent',
Expand Down
5 changes: 3 additions & 2 deletions data/lexicon/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import cities from './places/cities.js'
import countries from './places/countries.js'
import femaleNames from './people/femaleNames.js'
import firstnames from './people/firstnames.js'
import honorifics from './people/honorifics.js'
import lastnames from './people/lastnames.js'
import maleNames from './people/maleNames.js'
import people from './people/people.js'
Expand Down Expand Up @@ -61,6 +60,8 @@ import personDate from './switches/person-date.js'
import personVerb from './switches/person-verb.js'
import personPlace from './switches/person-place.js'
import unitNoun from './switches/unit-noun.js'
import honorificNoun from './switches/honorific-noun.js'


//add-in the generic, flat word-lists
const data = [
Expand Down Expand Up @@ -93,7 +94,6 @@ const data = [

[femaleNames, 'FemaleName'],
[firstnames, 'FirstName'],
[honorifics, 'Honorific'],
[lastnames, 'LastName'],
[maleNames, 'MaleName'],
[people, 'Person'],
Expand Down Expand Up @@ -125,6 +125,7 @@ const data = [
[personDate, 'Person|Date'],
[personVerb, 'Person|Verb'],
[unitNoun, 'Unit|Noun'],
[honorificNoun, 'Honorific|Noun'],
]
for (let i = 0; i < data.length; i++) {
const list = data[i][0]
Expand Down
1 change: 1 addition & 0 deletions data/lexicon/nouns/singulars.js
Original file line number Diff line number Diff line change
Expand Up @@ -402,6 +402,7 @@ export default [
'stone',
'man',
'tributary',
'flower',
]


2 changes: 1 addition & 1 deletion data/lexicon/switches/adj-noun.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ export default [
'periodical',
'pet',
'potential',
// 'premier',
'premier',
'present',
'principal',
'rear',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,34 @@
export default [
'admiral',
'ayatullah',
'baron',
'baroness',
'brigadier',
'captain',
'chancellor',
'colonel',
'commander',
'congressman',
'congresswoman',
'constable',
'corporal',
'councillor',
'count',
'doctor',
'dutchess',
'excellency',
'field marshal',
'first lady',
'first lieutenant',
// 'judge',
'king',
'lieutenant',
// 'count',
'captain',
'judge',
'king',
'lady',
'lord',
'magistrate',
'marshal',
'mayor',
// 'miss',
'missus',
'mister',
'officer',
'pastor',
'president',
Expand All @@ -35,9 +41,9 @@ export default [
'rabbi',
'rear admiral',
'reverend',
'second lieutenant',
'sergeant',
'secretary',
'sultan',
'taoiseach',
'vice admiral',
]
'vice admiral'
]
2 changes: 1 addition & 1 deletion data/lexicon/switches/noun-verb.js
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,6 @@ export default [
'float',
'flood',
'flow',
'flower',
'fly',
'focus',
'fog',
Expand Down Expand Up @@ -353,6 +352,7 @@ export default [
'milk',
'mind',
'mine',
'miss',
'mirror',
'mix',
'model',
Expand Down
1 change: 0 additions & 1 deletion data/lexicon/verbs/infinitives.js
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,6 @@ export default [
'mingle',
'minus',
'misplace',
'miss',
'molest',
'mourn',
'multiply',
Expand Down
15 changes: 8 additions & 7 deletions data/pairs/PastTense.js
Original file line number Diff line number Diff line change
Expand Up @@ -1928,7 +1928,7 @@ export default [
['bit', 'bite'],
['bled', 'bleed'],
['blitzed', 'blitz'],
['blown', 'blow'],
// ['blown', 'blow'],
['boned', 'bone'],
['burst', 'burst'],
['caned', 'cane'],
Expand Down Expand Up @@ -2038,10 +2038,11 @@ export default [
['levelled', 'level'],
['dared', 'dare'],
['swam', 'swim'],
['collide', 'collided'],
['slam', 'slammed'],
['shun', 'shunned'],
['prod', 'prodded'],
['outgrow', 'outgrew'],
['fulfil', 'fulfilled'],
['collided', 'collide'],
['slammed', 'slam'],
['shunned', 'shun'],
['prodded', 'prod'],
['outgrew', 'outgrow'],
['fulfilled', 'fulfil'],
['blew', 'blow'],
]
Loading

0 comments on commit 7098492

Please sign in to comment.