diff --git a/plugins/dates/scratch.js b/plugins/dates/scratch.js index 1fb67b7db..9f6e1bb88 100644 --- a/plugins/dates/scratch.js +++ b/plugins/dates/scratch.js @@ -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() 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 f5e2c2a73..eb3bae617 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 @@ -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 } } diff --git a/plugins/dates/src/api/parse/one/02-parse/05-explicit.js b/plugins/dates/src/api/parse/one/02-parse/05-explicit.js index 320868601..0d6d87fd0 100644 --- a/plugins/dates/src/api/parse/one/02-parse/05-explicit.js +++ b/plugins/dates/src/api/parse/one/02-parse/05-explicit.js @@ -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)