Skip to content

Commit

Permalink
support new unit in duration
Browse files Browse the repository at this point in the history
  • Loading branch information
spencermountain committed Jul 2, 2022
1 parent 10a4897 commit f2ac30a
Show file tree
Hide file tree
Showing 5 changed files with 2 additions and 7 deletions.
2 changes: 0 additions & 2 deletions plugins/dates/builds/compromise-dates.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -7597,8 +7597,6 @@
/** phrases like '2 months' */
View.prototype.durations = function (n) {
let m = this.match('#Value+ #Duration (and? #Value+ #Duration)?');
// add '20mins'
m = m.concat(this.match('(#Duration && /[0-9][a-z]+$/)'));

// not 'in 20 minutes'
m = m.notIf('#DateShift');
Expand Down
2 changes: 1 addition & 1 deletion plugins/dates/builds/compromise-dates.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion plugins/dates/builds/compromise-dates.mjs

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion plugins/dates/scratch.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import spacetime from 'spacetime'

// import datePlugin from './src/plugin.js'
import datePlugin from './builds/compromise-dates.mjs'
console.log(datePlugin)
nlp.plugin(datePlugin)
// nlp.verbose('tagger')
// nlp.verbose('date')
Expand Down
2 changes: 0 additions & 2 deletions plugins/dates/src/api/durations/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,6 @@ const addDurations = function (View) {
/** phrases like '2 months' */
View.prototype.durations = function (n) {
let m = this.match('#Value+ #Duration (and? #Value+ #Duration)?')
// add '20mins'
m = m.concat(this.match('(#Duration && /[0-9][a-z]+$/)'))

// not 'in 20 minutes'
m = m.notIf('#DateShift')
Expand Down

0 comments on commit f2ac30a

Please sign in to comment.