328 lines
5.5 KiB
JavaScript
328 lines
5.5 KiB
JavaScript
import test from 'tape'
|
|
import nlp from './_lib.js'
|
|
|
|
test('no dates', function (t) {
|
|
const arr = [
|
|
'laughing out loud',
|
|
'1 adult',
|
|
'we are separated',
|
|
'25',
|
|
'this is the one',
|
|
'this one',
|
|
'this past one',
|
|
'at single',
|
|
'at a couple of',
|
|
'at pairs',
|
|
'at a few',
|
|
'at dozens',
|
|
"single o'clock",
|
|
"dozens o'clock",
|
|
'Rat 6',
|
|
'rat 6',
|
|
'3 30',
|
|
'three twenty',
|
|
'at 650.650.6500',
|
|
'at 650-650-6500',
|
|
'two sixty a m',
|
|
'Pay ABC 2000',
|
|
'4a',
|
|
'4a.',
|
|
'A4 A5',
|
|
'palm',
|
|
'one two three',
|
|
'two hundred',
|
|
'a hundred',
|
|
'five hundred',
|
|
'room 404',
|
|
'page 12',
|
|
'chapter 3',
|
|
'version 2.0',
|
|
'size 10',
|
|
'size 10 medium',
|
|
'10 pack',
|
|
'pack of 6',
|
|
'6 pack',
|
|
'12 oz',
|
|
'16 oz bottle',
|
|
'2 liter',
|
|
'grade 5',
|
|
'level 3',
|
|
'step 4',
|
|
'phase 2',
|
|
'item 7',
|
|
'order 12345',
|
|
'invoice 2024',
|
|
'model 3',
|
|
'model y',
|
|
'iphone 14',
|
|
'windows 11',
|
|
'ps5',
|
|
'xbox series x',
|
|
'series 7',
|
|
'at once',
|
|
'at last',
|
|
'at least',
|
|
'at most',
|
|
'at best',
|
|
'at worst',
|
|
'at large',
|
|
'at length',
|
|
'at hand',
|
|
'at heart',
|
|
'at home',
|
|
'at work',
|
|
'at school',
|
|
'at risk',
|
|
'at stake',
|
|
'once upon a time',
|
|
'for the time being',
|
|
'in time',
|
|
'on time',
|
|
'in no time',
|
|
'all the time',
|
|
'most of the time',
|
|
'half the time',
|
|
'the whole time',
|
|
'a long time',
|
|
'some time',
|
|
'any time',
|
|
'every time',
|
|
'next time',
|
|
'last time',
|
|
'this time',
|
|
'one time',
|
|
'two times',
|
|
'three times',
|
|
'many times',
|
|
'time out',
|
|
'time off',
|
|
'time zone',
|
|
'prime time',
|
|
'lunch time',
|
|
'bed time',
|
|
'play time',
|
|
'show time',
|
|
'meanwhile',
|
|
'sometime',
|
|
'sometimes',
|
|
'anytime',
|
|
'thank you',
|
|
'may i help you',
|
|
'may be',
|
|
'may not',
|
|
'march on',
|
|
'march forward',
|
|
'happy birthday',
|
|
'good night',
|
|
'first class',
|
|
'second class',
|
|
'third party',
|
|
'fourth estate',
|
|
'fifth avenue',
|
|
'sixth sense',
|
|
'seventh heaven',
|
|
'eighth note',
|
|
'ninth inning',
|
|
'tenth grade',
|
|
'123 main street',
|
|
'456 oak ave',
|
|
'zip 90210',
|
|
'call 555-1212',
|
|
'555-1212',
|
|
'ext 402',
|
|
'id 12345',
|
|
'po box 123',
|
|
'suite 400',
|
|
'apt 2b',
|
|
'pay 200',
|
|
'pay 2000',
|
|
'cost 50',
|
|
'$50',
|
|
'$4.99',
|
|
'4 for 5',
|
|
'2 for 1',
|
|
'buy one get one',
|
|
'abc 123',
|
|
'form 1040',
|
|
'schedule c',
|
|
'4 out of 5',
|
|
'3 of 4',
|
|
'2 of 3',
|
|
'1 of 2',
|
|
'score 7',
|
|
'rated 10',
|
|
'top 10',
|
|
'top 5',
|
|
'4 stars',
|
|
'5 star',
|
|
'five star hotel',
|
|
'0 to 60',
|
|
'0-60',
|
|
'60 mph',
|
|
'100 km',
|
|
'1 on 1',
|
|
'one on one',
|
|
'2 on 2',
|
|
'3 on 3',
|
|
'4x4',
|
|
'24/7',
|
|
'7/11',
|
|
'9/11',
|
|
'11/9',
|
|
'101',
|
|
'404',
|
|
'911',
|
|
'411',
|
|
'twenty one',
|
|
'twenty one pilots',
|
|
'fifty fifty',
|
|
'sixty forty',
|
|
'eighty twenty',
|
|
'the one',
|
|
'the two',
|
|
'the three',
|
|
'number one',
|
|
'number two',
|
|
'no one',
|
|
'no two',
|
|
'first one',
|
|
'second one',
|
|
'third one',
|
|
'past tense',
|
|
'past due',
|
|
'past perfect',
|
|
'present tense',
|
|
'future tense',
|
|
'future proof',
|
|
'next up',
|
|
'next in line',
|
|
'last but not least',
|
|
'this and that',
|
|
'that one',
|
|
'those two',
|
|
'couple o\'clock',
|
|
'few o\'clock',
|
|
'pair o\'clock',
|
|
'several o\'clock',
|
|
'many o\'clock',
|
|
'rat pack',
|
|
'cat 5',
|
|
'cat 6 cable',
|
|
'dog 1',
|
|
'alpha 1',
|
|
'bravo 2',
|
|
'delta 4',
|
|
'laugh out loud',
|
|
'lol',
|
|
'rofl',
|
|
'separated at birth',
|
|
'we separated',
|
|
'adult content',
|
|
'2 adults',
|
|
'2 children',
|
|
'single room',
|
|
'double room',
|
|
'twin bed',
|
|
'couple of days',
|
|
'few days',
|
|
'several days',
|
|
'pair of shoes',
|
|
'dozens of',
|
|
'hundreds of',
|
|
'thousands of',
|
|
'java 8',
|
|
'python 3',
|
|
'es6',
|
|
'html5',
|
|
'http/1.1',
|
|
'ipv4',
|
|
'ipv6',
|
|
'at 4',
|
|
'at 5',
|
|
'at 6',
|
|
'at 7',
|
|
'at 8',
|
|
'at 9',
|
|
'at 10',
|
|
'at 11',
|
|
'at 12',
|
|
'pm session',
|
|
'a m radio',
|
|
'p m',
|
|
'twelve step',
|
|
'twelve steps',
|
|
'eleven plus two',
|
|
'twelve plus one',
|
|
'half past',
|
|
'ten past',
|
|
'twenty to',
|
|
'before long',
|
|
'after all',
|
|
'by the way',
|
|
'by night',
|
|
'since when',
|
|
'year round',
|
|
'year end',
|
|
'end user',
|
|
'end game',
|
|
'end point',
|
|
'start over',
|
|
'start up',
|
|
'start date field',
|
|
'janitor',
|
|
'march madness',
|
|
'august rush',
|
|
'decemberists',
|
|
'one adult two children',
|
|
'three adults',
|
|
'separated parents',
|
|
'separated columns',
|
|
'650 area code',
|
|
'650 number',
|
|
'rat 6 pack',
|
|
'rat 6 cable',
|
|
'three thirty flight',
|
|
'flight 330',
|
|
'gate 4',
|
|
'terminal 3',
|
|
'platform 9',
|
|
'row 4 seat 5',
|
|
'table for 2',
|
|
'party of 4',
|
|
'channel 4',
|
|
'station 5',
|
|
'line 6',
|
|
'figure 8',
|
|
'infinity 8',
|
|
'cloud 9',
|
|
'plan b',
|
|
'option c',
|
|
'choice 1',
|
|
'type 2 diabetes',
|
|
'covid 19',
|
|
'h1n1',
|
|
'b52',
|
|
'f16',
|
|
'747',
|
|
'404 not found',
|
|
'500 error',
|
|
'200 ok',
|
|
'at 650',
|
|
'at 1234',
|
|
'at 9999',
|
|
'pay abc',
|
|
'pay pal',
|
|
'pay rate',
|
|
'4 a m',
|
|
'5 p m',
|
|
'a 4 paper',
|
|
'b 12 vitamin',
|
|
// 'One Saturday he had been to market',
|
|
]
|
|
arr.forEach(function (str) {
|
|
const doc = nlp(str)
|
|
t.equal(doc.dates().length, 0, str)
|
|
})
|
|
t.end()
|
|
})
|