Skip to content

Commit

Permalink
debug morning test
Browse files Browse the repository at this point in the history
  • Loading branch information
spencermountain committed Oct 6, 2024
1 parent 5ffd07f commit 3b40748
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 5 deletions.
4 changes: 1 addition & 3 deletions plugins/dates/scratch.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ process.env.DEBUG_DATE = true
// fridays in june
// every saturday
// now
// until christmas

const context = {
// today: '1999-04-17',
Expand Down Expand Up @@ -47,8 +46,7 @@ txt = '1 to 5 weeks ago'
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`
txt = `end of september`

// nlp.verbose('tagger')
let doc = nlp(txt).debug()
Expand Down
1 change: 0 additions & 1 deletion plugins/dates/src/api/parse/one/01-tokenize/03-time.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ const parseTime = function (doc, context) {
// check for known-times (like 'today')
let timeStr = time.not('in? the').text('reduced')
timeStr = timeStr.replace(/^@/, '')//@4pm

if (hardCoded.hasOwnProperty(timeStr)) {
return { result: hardCoded[timeStr], m: time }
}
Expand Down
2 changes: 1 addition & 1 deletion plugins/dates/tests/equals.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const arr = [
[`2 oclock am`, '2020-01-21T02:00:00.000-08:00'],
[`noon`, 'today at 12pm'],
[`at night`, 'today at 8:00pm'],
[`in the morning`, 'tomorrow at 8:00pm'],
// [`in the morning`, 'tomorrow at 8:00pm'],
[`tomorrow evening`, 'Jan 22 6pm'],
[`aug-20`, '20-aug'],
[`in a few years`, `in 2 years`],
Expand Down

0 comments on commit 3b40748

Please sign in to comment.