half-past
Version:
natural-language date-parsing in javascript
15 lines (14 loc) • 509 B
JavaScript
const here = 'shift-tagger'
//
const shiftTagger = function(doc) {
if (doc.has('#Date')) {
//two weeks before
doc.match('#Cardinal #Duration (before|after)').tag('#ShiftDate', here)
//two weeks and three days before
doc.match('#Cardinal #Duration and? #ShiftDate').tag('#ShiftDate', here)
doc.match('#Cardinal #Duration and? #ShiftDate').tag('#ShiftDate', here)
doc.match('#Cardinal #Duration and? #ShiftDate').tag('#ShiftDate', here)
}
return doc
}
module.exports = shiftTagger