Skip to content

Commit

Permalink
tests passing
Browse files Browse the repository at this point in the history
  • Loading branch information
spencermountain committed Jan 16, 2024
1 parent a45865e commit baa16bb
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 11 deletions.
1 change: 1 addition & 0 deletions data/lexicon/adjectives/adjectives.js
Original file line number Diff line number Diff line change
Expand Up @@ -809,4 +809,5 @@ export default [
'greasy',
'pointy',
'testy',
'sold out',
]
7 changes: 2 additions & 5 deletions data/lexicon/switches/adj-noun.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
// the commercial market
// watching the commercial
export default [


'academic',
'adolescent',
'adult',
Expand Down Expand Up @@ -95,6 +93,7 @@ export default [
'mortal',
'nagging',
'novel',
'nuts',
'offensive',
'official',
'opposite',
Expand Down Expand Up @@ -166,6 +165,4 @@ export default [
'void',
'watershed',
'welcome',


]
]
6 changes: 3 additions & 3 deletions scratch.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
import nlp from './src/three.js'
// import plg from './plugins/dates/src/plugin.js'
// nlp.plugin(plg)
// nlp.verbose('tagger')
nlp.verbose('tagger')

let doc = nlp(`The meeting's scheduled for 3 PM`).debug()
let doc = nlp(`The concert's sold out`).debug()
// let doc = nlp(`The sun's setting`).debug()
console.log(doc.docs[0])
// console.log(doc.docs[0])
// nlp(`He'd never let us`).debug()
// nlp('john’s neat documents about georgia').debug()
// nlp(`John's talks about Georgia`).debug()
Expand Down
17 changes: 17 additions & 0 deletions src/2-two/contraction-two/compute/isPossessive.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ const beforePossessive = {
by: true, //by sunday's
for: true, //for sunday's
}
let adjLike = new Set(['too', 'also', 'enough', 'about'])
let nounLike = new Set(['is', 'are', 'did', 'were', 'could', 'should', 'must', 'had', 'have'])

const isPossessive = (terms, i) => {
let term = terms[i]
Expand Down Expand Up @@ -81,6 +83,21 @@ const isPossessive = (terms, i) => {
return false
}

// john's nuts
if (nextTerm.switch === 'Adj|Noun') {
let twoTerm = terms[i + 2]
if (!twoTerm) {
return false //adj
}
// john's nuts were..
if (nounLike.has(twoTerm.normal)) {
return true
}
// john's nuts about..
if (adjLike.has(twoTerm.normal)) {
return false //adj
}
}
//spencer's house
if (nextTerm.tags.has('Noun')) {
let nextStr = nextTerm.machine || nextTerm.normal
Expand Down
Loading

0 comments on commit baa16bb

Please sign in to comment.