Skip to content

Commit

Permalink
fix in-the-morning
Browse files Browse the repository at this point in the history
  • Loading branch information
spencermountain committed Oct 6, 2024
1 parent cb08277 commit 5ffd07f
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
1 change: 1 addition & 0 deletions plugins/dates/scratch.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ txt = 'in 2-4 years from now'
txt = 'in 1-2 weeks from now'
txt = 'in 1 to 2 months'
txt = `in a couple years`
txt = `in the morning`

// nlp.verbose('tagger')
let doc = nlp(txt).debug()
Expand Down
4 changes: 2 additions & 2 deletions plugins/dates/src/api/parse/one/01-tokenize/03-time.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,9 @@ const parseTime = function (doc, context) {
let s = spacetime.now(context.timezone)
let now = s.clone()
// check for known-times (like 'today')
let timeStr = time.not('in the').text('reduced')
let timeStr = time.not('in? the').text('reduced')
timeStr = timeStr.replace(/^@/, '')//@4pm
// console.log(timeStr)

if (hardCoded.hasOwnProperty(timeStr)) {
return { result: hardCoded[timeStr], m: time }
}
Expand Down
1 change: 0 additions & 1 deletion plugins/dates/src/api/parse/one/02-parse/05-explicit.js
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,6 @@ const parseExplicit = function (doc, context) {
return unit
}
}

let str = doc.text('reduced')
if (!str) {
return new Moment(context.today, null, context)
Expand Down

0 comments on commit 5ffd07f

Please sign in to comment.