From 3b40748fe667baffa3465b01b8d39d375214d7bd Mon Sep 17 00:00:00 2001 From: spencer kelly Date: Sun, 6 Oct 2024 10:51:44 -0400 Subject: [PATCH] debug morning test --- plugins/dates/scratch.js | 4 +--- plugins/dates/src/api/parse/one/01-tokenize/03-time.js | 1 - plugins/dates/tests/equals.test.js | 2 +- 3 files changed, 2 insertions(+), 5 deletions(-) diff --git a/plugins/dates/scratch.js b/plugins/dates/scratch.js index 9f6e1bb88..7f5a226fa 100644 --- a/plugins/dates/scratch.js +++ b/plugins/dates/scratch.js @@ -18,7 +18,6 @@ process.env.DEBUG_DATE = true // fridays in june // every saturday // now -// until christmas const context = { // today: '1999-04-17', @@ -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() diff --git a/plugins/dates/src/api/parse/one/01-tokenize/03-time.js b/plugins/dates/src/api/parse/one/01-tokenize/03-time.js index eb3bae617..340974be2 100644 --- a/plugins/dates/src/api/parse/one/01-tokenize/03-time.js +++ b/plugins/dates/src/api/parse/one/01-tokenize/03-time.js @@ -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 } } diff --git a/plugins/dates/tests/equals.test.js b/plugins/dates/tests/equals.test.js index b8e9af840..ecafa1f9a 100644 --- a/plugins/dates/tests/equals.test.js +++ b/plugins/dates/tests/equals.test.js @@ -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`],