Skip to content

Commit

Permalink
177 failing
Browse files Browse the repository at this point in the history
  • Loading branch information
spencermountain committed Nov 8, 2021
1 parent a1ca688 commit 784130c
Show file tree
Hide file tree
Showing 17 changed files with 42 additions and 20 deletions.
1 change: 1 addition & 0 deletions lib/lexicon/misc/expressions.js
Expand Up @@ -61,6 +61,7 @@ export default [
'hurray',
'huzzah',
'jeez',
'lah',
'lmao',
'lmfao',
'lol',
Expand Down
1 change: 0 additions & 1 deletion lib/lexicon/verbs/phrasals.js
Expand Up @@ -620,7 +620,6 @@ export default [
'settle in',
'settle out',
'settle up',
'settle for',
'shack up',
'shade in',
'shake down',
Expand Down
1 change: 1 addition & 0 deletions lib/switches/adj-past.js
Expand Up @@ -104,6 +104,7 @@ export default {
'simulated',
'specialized',
'specified',
'settled',
'steamed',
'stereotyped',
'striped',
Expand Down
1 change: 1 addition & 0 deletions lib/switches/clues/adjective.js
Expand Up @@ -44,5 +44,6 @@ export default {
afterWords: {
too: jj, //insulting too
also: jj, //insulting too
or: jj, //insulting or
},
}
2 changes: 2 additions & 0 deletions lib/switches/clues/gerund.js
Expand Up @@ -42,6 +42,8 @@ export default {
hate: g,
hates: g,
hated: g,
was: g,//was working
is: g,
},
afterWords: {
you: g, //telling you
Expand Down
2 changes: 1 addition & 1 deletion lib/switches/clues/noun.js
Expand Up @@ -23,7 +23,7 @@ export default {
ownTags: { ProperNoun: nn },
beforeWords: {
with: nn,//with cakes
was: nn, //was time
was: nn, //was time -- was working
is: nn, //
of: nn, //of power
for: nn, //for rats
Expand Down
3 changes: 3 additions & 0 deletions lib/switches/clues/past.js
Expand Up @@ -25,5 +25,8 @@ export default {
in: pst, //crowded in
up: pst, //heated up
down: pst, //hammered down
for: pst, //settled for
the: pst, //settled the
with: pst, //obsessed with
},
}
10 changes: 10 additions & 0 deletions lib/switches/clues/verb.js
Expand Up @@ -24,6 +24,15 @@ export default {
to: vb, //to date
please: vb, //please check
will: vb, //will check
have: vb,
had: vb,
would: vb,
could: vb,
should: vb,
do: vb,
does: vb,
can: vb,
must: vb,
},
afterWords: {
the: vb, //echo the
Expand All @@ -36,5 +45,6 @@ export default {
a: vb, //covers a
an: vb, //covers an
from: vb, //ranges from
// for: vb, //settled for
},
}
8 changes: 2 additions & 6 deletions scratch.js
Expand Up @@ -44,17 +44,15 @@ let txt
// txt= 'Thursday works for me.'
// txt= 'She is going to be a kinesiologist, sports injury therapist.'
// txt= 'Does that work?'
// txt= 'Bob Bowen'
// txt= 'Drew Fossum'
txt = 'Bob Bowen'
// txt= 'Drew Fossum'
// txt = 'Drew Fossum'
// txt= 'bob k'
// txt= "You're right, Sue."
// txt= 'Day One Interviews Day Two Interviews'
// txt= 'Sue and Jeff --'
// txt= 'Are you playing golf?'
// txt= 'Has Liz finished with gathering the documents?'
// txt= 'Increases longevity.'
txt = 'Dr. Fortier was one of 15 people to receive the Carnegie Medal on Monday.'
// txt= 'The Superdome stadium is without power, and toilets are overflowing.'
// txt= 'You are requesting a legitimate service and you are paying for it !!'
// txt= 'Visit message boards and post this article as a new message by highlighting the text of this letter and selecting paste from the edit menu.'
Expand All @@ -76,9 +74,7 @@ txt = 'Dr. Fortier was one of 15 people to receive the Carnegie Medal on Monday.
// txt= 'I had a conversation with the woman running this place in April 2010.'
// txt= 'Great Cookies, Cakes, and Customer Service'
// txt= 'May, 2009.'
// txt= 'I put the coffee thing in hot water and settled for a cup of weak coffee.'

txt = 'yo we should'
let doc = nlp(txt).debug()

// bug 1
Expand Down
2 changes: 2 additions & 0 deletions src/2-two/postTagger/model/verbs/verb-noun.js
Expand Up @@ -161,6 +161,8 @@ export default [
{ match: '(do|did|will) [#Singular] #Noun', group: 0, tag: 'PresentTense', reason: 'do-serve-fish' },
// tastes good
{ match: '[(tastes|smells)] #Adverb? #Adjective', group: 0, tag: 'PresentTense', reason: 'tastes-good' },
// are you plauing golf
{ match: '^are #Pronoun [#Noun]', group: 0, ifNo: ['here', 'there'], tag: 'Verb', reason: 'are-you-x' },
// ignoring commute
{
match: '#Copula #Gerund [#PresentTense] !by?',
Expand Down
2 changes: 1 addition & 1 deletion src/2-two/preTagger/compute/3rd-pass/04-switchChange.js
Expand Up @@ -76,8 +76,8 @@ const swtichLexicon = function (terms, i, model) {
let parents = model.two.tagSet[tag].parents
fastTag(term, parents, `3-switch-infer from ${tag}`)
}
break //one hint is good-enough
}
break //one hint is good-enough
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/2-two/preTagger/model/lexicon/_data.js

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

10 changes: 5 additions & 5 deletions src/2-two/preTagger/model/switches/_data.js

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

5 changes: 5 additions & 0 deletions src/2-two/preTagger/model/switches/index.js
Expand Up @@ -8,6 +8,7 @@ const toTitleCase = function (str) {
const titleCase = function (obj) {
return Object.keys(obj).reduce((h, key) => {
let name = toTitleCase(key).replace(/tense$/, 'Tense')
name = toTitleCase(key).replace(/noun$/, 'Noun')
h[name] = obj[key]
return h
}, {})
Expand Down Expand Up @@ -44,4 +45,8 @@ Object.keys(presentPlural.words).forEach(str => {
presentPlural.words = words
switches.presentPlural = presentPlural

// random ad-hoc changes -
// 'was time' vs 'was working'
switches.gerundNoun.beforeWords.was = 'Gerund'

export default switches
4 changes: 4 additions & 0 deletions src/3-three/nouns/find.js
Expand Up @@ -17,6 +17,10 @@ const findNouns = function (doc) {
m = m.splitOn('[#Pronoun] (#Determiner|#Value)', 0)
// the noise the slide makes
m = m.splitBefore('#Noun [(the|a|an)] #Adjective? #Noun', 0)
// here spencer slept
m = m.splitOn('[(here|there)] #Noun', 0)
// put it there
m = m.splitOn('[#Noun] (here|there)', 0)

//ensure there's actually a noun
m = m.if('#Noun')
Expand Down
2 changes: 2 additions & 0 deletions tests/three/nouns/noun-find.test.js
Expand Up @@ -94,6 +94,8 @@ test('noun-phrases', function (t) {
`the unlikely captain of the largest international basketball team`,
['the unlikely captain of the largest international basketball team'],
],
[`are you here spencer?`, ['you', 'here', 'spencer?']],
[`put it there`, ['it', 'there']],
]
arr.forEach(function (a) {
const nouns = nlp(a[0]).nouns().out('array')
Expand Down

0 comments on commit 784130c

Please sign in to comment.