340 lines
22 KiB
JavaScript
340 lines
22 KiB
JavaScript
import test from 'tape'
|
|
import nlp from './_lib.js'
|
|
|
|
const context = {
|
|
today: '2024-09-24',
|
|
}
|
|
|
|
const arr = [
|
|
{ str: 'in 2 to 4 days', start: '2024-09-26', end: '2024-09-28' },
|
|
{ str: 'in 2-4 days', start: '2024-09-26', end: '2024-09-28' },
|
|
{ str: 'in two to four days', start: '2024-09-26', end: '2024-09-28' },
|
|
{ str: '2 to 4 days ago', start: '2024-09-20', end: '2024-09-22' },
|
|
{ str: '2-4 days ago', start: '2024-09-20', end: '2024-09-22' },
|
|
{ str: 'two to four days ago', start: '2024-09-20', end: '2024-09-22' },
|
|
|
|
// { str: 'in 1 to 2 weeks', start: '2024-10-01', end: '2024-10-07' },
|
|
// { str: 'in 1-2 weeks', start: '2024-10-01', end: '2024-10-07' },
|
|
// { str: 'in one to two weeks', start: '2024-10-01', end: '2024-10-07' },
|
|
{ str: '1 to 2 weeks ago', start: '2024-09-10', end: '2024-09-17' },
|
|
{ str: '1-2 weeks ago', start: '2024-09-10', end: '2024-09-17' },
|
|
{ str: 'one to two weeks ago', start: '2024-09-10', end: '2024-09-17' },
|
|
|
|
{ str: 'in 1 to 5 months', start: '2024-10-24', end: '2025-02-24' },
|
|
{ str: 'in 1-5 months', start: '2024-10-24', end: '2025-02-24' },
|
|
{ str: 'in one to five months', start: '2024-10-24', end: '2025-02-24' },
|
|
{ str: '1 to 5 months ago', start: '2024-04-24', end: '2024-08-24' },
|
|
{ str: '1-5 months ago', start: '2024-04-24', end: '2024-08-24' },
|
|
{ str: 'one to five months ago', start: '2024-04-24', end: '2024-08-24' },
|
|
|
|
{ str: 'in 1-2 years', start: '2025-09-24', end: '2026-09-24' },
|
|
{ str: 'in 2 to 4 years', start: '2026-09-24', end: '2028-09-24' },
|
|
{ str: 'in 2-4 years', start: '2026-09-24', end: '2028-09-24' },
|
|
{ str: 'in two to four years', start: '2026-09-24', end: '2028-09-24' },
|
|
{ str: '2 to 4 years ago', start: '2020-09-24', end: '2022-09-24' },
|
|
{ str: '2-4 years ago', start: '2020-09-24', end: '2022-09-24' },
|
|
{ str: 'two to four years ago', start: '2020-09-24', end: '2022-09-24' },
|
|
{ str: 'in 3 to 6 days', start: '2024-09-27', end: '2024-09-30' },
|
|
{ str: 'in 3-6 days', start: '2024-09-27', end: '2024-09-30' },
|
|
{ str: 'in three to six days', start: '2024-09-27', end: '2024-09-30' },
|
|
{ str: '3 to 6 days ago', start: '2024-09-18', end: '2024-09-21' },
|
|
{ str: '3-6 days ago', start: '2024-09-18', end: '2024-09-21' },
|
|
{ str: 'three to six days ago', start: '2024-09-18', end: '2024-09-21' },
|
|
{ str: 'in 3-5 years', start: '2027-09-24', end: '2029-09-24' },
|
|
{ str: 'in three to five years', start: '2027-09-24', end: '2029-09-24' },
|
|
{ str: '3 to 5 years ago', start: '2019-09-24', end: '2021-09-24' },
|
|
{ str: 'three to five years ago', start: '2019-09-24', end: '2021-09-24' },
|
|
{ str: 'in 1 to 2 days', start: '2024-09-25', end: '2024-09-26' },
|
|
{ str: 'in 1-2 days', start: '2024-09-25', end: '2024-09-26' },
|
|
{ str: 'in one to two days', start: '2024-09-25', end: '2024-09-26' },
|
|
{ str: '1 to 2 days ago', start: '2024-09-22', end: '2024-09-23' },
|
|
{ str: '1-2 days ago', start: '2024-09-22', end: '2024-09-23' },
|
|
{ str: 'one to two days ago', start: '2024-09-22', end: '2024-09-23' },
|
|
{ str: 'in 1 to 2 weeks', start: '2024-10-01', end: '2024-10-08' },
|
|
{ str: 'in 1-2 weeks', start: '2024-10-01', end: '2024-10-08' },
|
|
{ str: 'in one to two weeks', start: '2024-10-01', end: '2024-10-08' },
|
|
{ str: 'in 1 to 2 months', start: '2024-10-24', end: '2024-11-24' },
|
|
{ str: 'in 1-2 months', start: '2024-10-24', end: '2024-11-24' },
|
|
{ str: 'in one to two months', start: '2024-10-24', end: '2024-11-24' },
|
|
{ str: '1 to 2 months ago', start: '2024-07-24', end: '2024-08-24' },
|
|
{ str: '1-2 months ago', start: '2024-07-24', end: '2024-08-24' },
|
|
{ str: 'one to two months ago', start: '2024-07-24', end: '2024-08-24' },
|
|
{ str: 'in 1 to 2 years', start: '2025-09-24', end: '2026-09-24' },
|
|
{ str: 'in one to two years', start: '2025-09-24', end: '2026-09-24' },
|
|
{ str: '1 to 2 years ago', start: '2022-09-24', end: '2023-09-24' },
|
|
{ str: '1-2 years ago', start: '2022-09-24', end: '2023-09-24' },
|
|
{ str: 'one to two years ago', start: '2022-09-24', end: '2023-09-24' },
|
|
{ str: 'in 1 to 3 days', start: '2024-09-25', end: '2024-09-27' },
|
|
{ str: 'in 1-3 days', start: '2024-09-25', end: '2024-09-27' },
|
|
{ str: 'in one to three days', start: '2024-09-25', end: '2024-09-27' },
|
|
{ str: '1 to 3 days ago', start: '2024-09-21', end: '2024-09-23' },
|
|
{ str: '1-3 days ago', start: '2024-09-21', end: '2024-09-23' },
|
|
{ str: 'one to three days ago', start: '2024-09-21', end: '2024-09-23' },
|
|
{ str: 'in 1 to 3 weeks', start: '2024-10-01', end: '2024-10-15' },
|
|
{ str: 'in 1-3 weeks', start: '2024-10-01', end: '2024-10-15' },
|
|
{ str: 'in one to three weeks', start: '2024-10-01', end: '2024-10-15' },
|
|
{ str: '1 to 3 weeks ago', start: '2024-09-03', end: '2024-09-17' },
|
|
{ str: '1-3 weeks ago', start: '2024-09-03', end: '2024-09-17' },
|
|
{ str: 'one to three weeks ago', start: '2024-09-03', end: '2024-09-17' },
|
|
{ str: 'in 1 to 3 months', start: '2024-10-24', end: '2024-12-24' },
|
|
{ str: 'in 1-3 months', start: '2024-10-24', end: '2024-12-24' },
|
|
{ str: 'in one to three months', start: '2024-10-24', end: '2024-12-24' },
|
|
{ str: '1 to 3 months ago', start: '2024-06-24', end: '2024-08-24' },
|
|
{ str: '1-3 months ago', start: '2024-06-24', end: '2024-08-24' },
|
|
{ str: 'one to three months ago', start: '2024-06-24', end: '2024-08-24' },
|
|
{ str: 'in 1 to 3 years', start: '2025-09-24', end: '2027-09-24' },
|
|
{ str: 'in 1-3 years', start: '2025-09-24', end: '2027-09-24' },
|
|
{ str: 'in one to three years', start: '2025-09-24', end: '2027-09-24' },
|
|
{ str: '1 to 3 years ago', start: '2021-09-24', end: '2023-09-24' },
|
|
{ str: '1-3 years ago', start: '2021-09-24', end: '2023-09-24' },
|
|
{ str: 'one to three years ago', start: '2021-09-24', end: '2023-09-24' },
|
|
{ str: 'in 2 to 3 days', start: '2024-09-26', end: '2024-09-27' },
|
|
{ str: 'in 2-3 days', start: '2024-09-26', end: '2024-09-27' },
|
|
{ str: 'in two to three days', start: '2024-09-26', end: '2024-09-27' },
|
|
{ str: '2 to 3 days ago', start: '2024-09-21', end: '2024-09-22' },
|
|
{ str: '2-3 days ago', start: '2024-09-21', end: '2024-09-22' },
|
|
{ str: 'two to three days ago', start: '2024-09-21', end: '2024-09-22' },
|
|
{ str: 'in 2 to 3 weeks', start: '2024-10-08', end: '2024-10-15' },
|
|
{ str: 'in 2-3 weeks', start: '2024-10-08', end: '2024-10-15' },
|
|
{ str: 'in two to three weeks', start: '2024-10-08', end: '2024-10-15' },
|
|
{ str: '2 to 3 weeks ago', start: '2024-09-03', end: '2024-09-10' },
|
|
{ str: '2-3 weeks ago', start: '2024-09-03', end: '2024-09-10' },
|
|
{ str: 'two to three weeks ago', start: '2024-09-03', end: '2024-09-10' },
|
|
{ str: 'in 2 to 3 months', start: '2024-11-24', end: '2024-12-24' },
|
|
{ str: 'in 2-3 months', start: '2024-11-24', end: '2024-12-24' },
|
|
{ str: 'in two to three months', start: '2024-11-24', end: '2024-12-24' },
|
|
{ str: '2 to 3 months ago', start: '2024-06-24', end: '2024-07-24' },
|
|
{ str: '2-3 months ago', start: '2024-06-24', end: '2024-07-24' },
|
|
{ str: 'two to three months ago', start: '2024-06-24', end: '2024-07-24' },
|
|
{ str: 'in 2 to 3 years', start: '2026-09-24', end: '2027-09-24' },
|
|
{ str: 'in 2-3 years', start: '2026-09-24', end: '2027-09-24' },
|
|
{ str: 'in two to three years', start: '2026-09-24', end: '2027-09-24' },
|
|
{ str: '2 to 3 years ago', start: '2021-09-24', end: '2022-09-24' },
|
|
{ str: '2-3 years ago', start: '2021-09-24', end: '2022-09-24' },
|
|
{ str: 'two to three years ago', start: '2021-09-24', end: '2022-09-24' },
|
|
{ str: 'in 2 to 4 weeks', start: '2024-10-08', end: '2024-10-22' },
|
|
{ str: 'in 2-4 weeks', start: '2024-10-08', end: '2024-10-22' },
|
|
{ str: 'in two to four weeks', start: '2024-10-08', end: '2024-10-22' },
|
|
{ str: '2 to 4 weeks ago', start: '2024-08-27', end: '2024-09-10' },
|
|
{ str: '2-4 weeks ago', start: '2024-08-27', end: '2024-09-10' },
|
|
{ str: 'two to four weeks ago', start: '2024-08-27', end: '2024-09-10' },
|
|
{ str: 'in 2 to 4 months', start: '2024-11-24', end: '2025-01-24' },
|
|
{ str: 'in 2-4 months', start: '2024-11-24', end: '2025-01-24' },
|
|
{ str: 'in two to four months', start: '2024-11-24', end: '2025-01-24' },
|
|
{ str: '2 to 4 months ago', start: '2024-05-24', end: '2024-07-24' },
|
|
{ str: '2-4 months ago', start: '2024-05-24', end: '2024-07-24' },
|
|
{ str: 'two to four months ago', start: '2024-05-24', end: '2024-07-24' },
|
|
{ str: 'in 2 to 5 days', start: '2024-09-26', end: '2024-09-29' },
|
|
{ str: 'in 2-5 days', start: '2024-09-26', end: '2024-09-29' },
|
|
{ str: 'in two to five days', start: '2024-09-26', end: '2024-09-29' },
|
|
{ str: '2 to 5 days ago', start: '2024-09-19', end: '2024-09-22' },
|
|
{ str: '2-5 days ago', start: '2024-09-19', end: '2024-09-22' },
|
|
{ str: 'two to five days ago', start: '2024-09-19', end: '2024-09-22' },
|
|
{ str: 'in 2 to 5 weeks', start: '2024-10-08', end: '2024-10-29' },
|
|
{ str: 'in 2-5 weeks', start: '2024-10-08', end: '2024-10-29' },
|
|
{ str: 'in two to five weeks', start: '2024-10-08', end: '2024-10-29' },
|
|
{ str: '2 to 5 weeks ago', start: '2024-08-20', end: '2024-09-10' },
|
|
{ str: '2-5 weeks ago', start: '2024-08-20', end: '2024-09-10' },
|
|
{ str: 'two to five weeks ago', start: '2024-08-20', end: '2024-09-10' },
|
|
{ str: 'in 2 to 5 months', start: '2024-11-24', end: '2025-02-24' },
|
|
{ str: 'in 2-5 months', start: '2024-11-24', end: '2025-02-24' },
|
|
{ str: 'in two to five months', start: '2024-11-24', end: '2025-02-24' },
|
|
{ str: '2 to 5 months ago', start: '2024-04-24', end: '2024-07-24' },
|
|
{ str: '2-5 months ago', start: '2024-04-24', end: '2024-07-24' },
|
|
{ str: 'two to five months ago', start: '2024-04-24', end: '2024-07-24' },
|
|
{ str: 'in 2 to 5 years', start: '2026-09-24', end: '2029-09-24' },
|
|
{ str: 'in 2-5 years', start: '2026-09-24', end: '2029-09-24' },
|
|
{ str: 'in two to five years', start: '2026-09-24', end: '2029-09-24' },
|
|
{ str: '2 to 5 years ago', start: '2019-09-24', end: '2022-09-24' },
|
|
{ str: '2-5 years ago', start: '2019-09-24', end: '2022-09-24' },
|
|
{ str: 'two to five years ago', start: '2019-09-24', end: '2022-09-24' },
|
|
{ str: 'in 3 to 4 days', start: '2024-09-27', end: '2024-09-28' },
|
|
{ str: 'in 3-4 days', start: '2024-09-27', end: '2024-09-28' },
|
|
{ str: 'in three to four days', start: '2024-09-27', end: '2024-09-28' },
|
|
{ str: '3 to 4 days ago', start: '2024-09-20', end: '2024-09-21' },
|
|
{ str: '3-4 days ago', start: '2024-09-20', end: '2024-09-21' },
|
|
{ str: 'three to four days ago', start: '2024-09-20', end: '2024-09-21' },
|
|
{ str: 'in 3 to 4 weeks', start: '2024-10-15', end: '2024-10-22' },
|
|
{ str: 'in 3-4 weeks', start: '2024-10-15', end: '2024-10-22' },
|
|
{ str: 'in three to four weeks', start: '2024-10-15', end: '2024-10-22' },
|
|
{ str: '3 to 4 weeks ago', start: '2024-08-27', end: '2024-09-03' },
|
|
{ str: '3-4 weeks ago', start: '2024-08-27', end: '2024-09-03' },
|
|
{ str: 'three to four weeks ago', start: '2024-08-27', end: '2024-09-03' },
|
|
{ str: 'in 3 to 4 months', start: '2024-12-24', end: '2025-01-24' },
|
|
{ str: 'in 3-4 months', start: '2024-12-24', end: '2025-01-24' },
|
|
{ str: 'in three to four months', start: '2024-12-24', end: '2025-01-24' },
|
|
{ str: '3 to 4 months ago', start: '2024-05-24', end: '2024-06-24' },
|
|
{ str: '3-4 months ago', start: '2024-05-24', end: '2024-06-24' },
|
|
{ str: 'three to four months ago', start: '2024-05-24', end: '2024-06-24' },
|
|
{ str: 'in 3 to 4 years', start: '2027-09-24', end: '2028-09-24' },
|
|
{ str: 'in 3-4 years', start: '2027-09-24', end: '2028-09-24' },
|
|
{ str: 'in three to four years', start: '2027-09-24', end: '2028-09-24' },
|
|
{ str: '3 to 4 years ago', start: '2020-09-24', end: '2021-09-24' },
|
|
{ str: '3-4 years ago', start: '2020-09-24', end: '2021-09-24' },
|
|
{ str: 'three to four years ago', start: '2020-09-24', end: '2021-09-24' },
|
|
{ str: 'in 3 to 5 days', start: '2024-09-27', end: '2024-09-29' },
|
|
{ str: 'in 3-5 days', start: '2024-09-27', end: '2024-09-29' },
|
|
{ str: 'in three to five days', start: '2024-09-27', end: '2024-09-29' },
|
|
{ str: '3 to 5 days ago', start: '2024-09-19', end: '2024-09-21' },
|
|
{ str: '3-5 days ago', start: '2024-09-19', end: '2024-09-21' },
|
|
{ str: 'three to five days ago', start: '2024-09-19', end: '2024-09-21' },
|
|
{ str: 'in 3 to 5 weeks', start: '2024-10-15', end: '2024-10-29' },
|
|
{ str: 'in 3-5 weeks', start: '2024-10-15', end: '2024-10-29' },
|
|
{ str: 'in three to five weeks', start: '2024-10-15', end: '2024-10-29' },
|
|
{ str: '3 to 5 weeks ago', start: '2024-08-20', end: '2024-09-03' },
|
|
{ str: '3-5 weeks ago', start: '2024-08-20', end: '2024-09-03' },
|
|
{ str: 'three to five weeks ago', start: '2024-08-20', end: '2024-09-03' },
|
|
{ str: 'in 3 to 5 months', start: '2024-12-24', end: '2025-02-24' },
|
|
{ str: 'in 3-5 months', start: '2024-12-24', end: '2025-02-24' },
|
|
{ str: 'in three to five months', start: '2024-12-24', end: '2025-02-24' },
|
|
{ str: '3 to 5 months ago', start: '2024-04-24', end: '2024-06-24' },
|
|
{ str: '3-5 months ago', start: '2024-04-24', end: '2024-06-24' },
|
|
{ str: 'three to five months ago', start: '2024-04-24', end: '2024-06-24' },
|
|
{ str: 'in 3 to 5 years', start: '2027-09-24', end: '2029-09-24' },
|
|
{ str: '3-5 years ago', start: '2019-09-24', end: '2021-09-24' },
|
|
{ str: 'in 3 to 6 weeks', start: '2024-10-15', end: '2024-11-05' },
|
|
{ str: 'in 3-6 weeks', start: '2024-10-15', end: '2024-11-05' },
|
|
{ str: 'in three to six weeks', start: '2024-10-15', end: '2024-11-05' },
|
|
{ str: '3 to 6 weeks ago', start: '2024-08-13', end: '2024-09-03' },
|
|
{ str: '3-6 weeks ago', start: '2024-08-13', end: '2024-09-03' },
|
|
{ str: 'three to six weeks ago', start: '2024-08-13', end: '2024-09-03' },
|
|
{ str: 'in 3 to 6 months', start: '2024-12-24', end: '2025-03-24' },
|
|
{ str: 'in 3-6 months', start: '2024-12-24', end: '2025-03-24' },
|
|
{ str: 'in three to six months', start: '2024-12-24', end: '2025-03-24' },
|
|
{ str: '3 to 6 months ago', start: '2024-03-24', end: '2024-06-24' },
|
|
{ str: '3-6 months ago', start: '2024-03-24', end: '2024-06-24' },
|
|
{ str: 'three to six months ago', start: '2024-03-24', end: '2024-06-24' },
|
|
{ str: 'in 3 to 6 years', start: '2027-09-24', end: '2030-09-24' },
|
|
{ str: 'in 3-6 years', start: '2027-09-24', end: '2030-09-24' },
|
|
{ str: 'in three to six years', start: '2027-09-24', end: '2030-09-24' },
|
|
{ str: '3 to 6 years ago', start: '2018-09-24', end: '2021-09-24' },
|
|
{ str: '3-6 years ago', start: '2018-09-24', end: '2021-09-24' },
|
|
{ str: 'three to six years ago', start: '2018-09-24', end: '2021-09-24' },
|
|
{ str: 'in 4 to 6 days', start: '2024-09-28', end: '2024-09-30' },
|
|
{ str: 'in 4-6 days', start: '2024-09-28', end: '2024-09-30' },
|
|
{ str: 'in four to six days', start: '2024-09-28', end: '2024-09-30' },
|
|
{ str: '4 to 6 days ago', start: '2024-09-18', end: '2024-09-20' },
|
|
{ str: '4-6 days ago', start: '2024-09-18', end: '2024-09-20' },
|
|
{ str: 'four to six days ago', start: '2024-09-18', end: '2024-09-20' },
|
|
{ str: 'in 4 to 6 weeks', start: '2024-10-22', end: '2024-11-05' },
|
|
{ str: 'in 4-6 weeks', start: '2024-10-22', end: '2024-11-05' },
|
|
{ str: 'in four to six weeks', start: '2024-10-22', end: '2024-11-05' },
|
|
{ str: '4 to 6 weeks ago', start: '2024-08-13', end: '2024-08-27' },
|
|
{ str: '4-6 weeks ago', start: '2024-08-13', end: '2024-08-27' },
|
|
{ str: 'four to six weeks ago', start: '2024-08-13', end: '2024-08-27' },
|
|
{ str: 'in 4 to 6 months', start: '2025-01-24', end: '2025-03-24' },
|
|
{ str: 'in 4-6 months', start: '2025-01-24', end: '2025-03-24' },
|
|
{ str: 'in four to six months', start: '2025-01-24', end: '2025-03-24' },
|
|
{ str: '4 to 6 months ago', start: '2024-03-24', end: '2024-05-24' },
|
|
{ str: '4-6 months ago', start: '2024-03-24', end: '2024-05-24' },
|
|
{ str: 'four to six months ago', start: '2024-03-24', end: '2024-05-24' },
|
|
{ str: 'in 4 to 6 years', start: '2028-09-24', end: '2030-09-24' },
|
|
{ str: 'in 4-6 years', start: '2028-09-24', end: '2030-09-24' },
|
|
{ str: 'in four to six years', start: '2028-09-24', end: '2030-09-24' },
|
|
{ str: '4 to 6 years ago', start: '2018-09-24', end: '2020-09-24' },
|
|
{ str: '4-6 years ago', start: '2018-09-24', end: '2020-09-24' },
|
|
{ str: 'four to six years ago', start: '2018-09-24', end: '2020-09-24' },
|
|
{ str: 'in 5 to 10 days', start: '2024-09-29', end: '2024-10-04' },
|
|
{ str: 'in 5-10 days', start: '2024-09-29', end: '2024-10-04' },
|
|
{ str: 'in five to ten days', start: '2024-09-29', end: '2024-10-04' },
|
|
{ str: '5 to 10 days ago', start: '2024-09-14', end: '2024-09-19' },
|
|
{ str: '5-10 days ago', start: '2024-09-14', end: '2024-09-19' },
|
|
{ str: 'five to ten days ago', start: '2024-09-14', end: '2024-09-19' },
|
|
{ str: 'in 5 to 10 weeks', start: '2024-10-29', end: '2024-12-03' },
|
|
{ str: 'in 5-10 weeks', start: '2024-10-29', end: '2024-12-03' },
|
|
{ str: 'in five to ten weeks', start: '2024-10-29', end: '2024-12-03' },
|
|
{ str: '5 to 10 weeks ago', start: '2024-07-16', end: '2024-08-20' },
|
|
{ str: '5-10 weeks ago', start: '2024-07-16', end: '2024-08-20' },
|
|
{ str: 'five to ten weeks ago', start: '2024-07-16', end: '2024-08-20' },
|
|
{ str: 'in 5 to 10 months', start: '2025-02-24', end: '2025-07-24' },
|
|
{ str: 'in 5-10 months', start: '2025-02-24', end: '2025-07-24' },
|
|
{ str: 'in five to ten months', start: '2025-02-24', end: '2025-07-24' },
|
|
{ str: '5 to 10 months ago', start: '2023-11-24', end: '2024-04-24' },
|
|
{ str: '5-10 months ago', start: '2023-11-24', end: '2024-04-24' },
|
|
{ str: 'five to ten months ago', start: '2023-11-24', end: '2024-04-24' },
|
|
{ str: 'in 5 to 10 years', start: '2029-09-24', end: '2034-09-24' },
|
|
{ str: 'in 5-10 years', start: '2029-09-24', end: '2034-09-24' },
|
|
{ str: 'in five to ten years', start: '2029-09-24', end: '2034-09-24' },
|
|
{ str: '5 to 10 years ago', start: '2014-09-24', end: '2019-09-24' },
|
|
{ str: '5-10 years ago', start: '2014-09-24', end: '2019-09-24' },
|
|
{ str: 'five to ten years ago', start: '2014-09-24', end: '2019-09-24' },
|
|
{ str: 'in 1 to 5 days', start: '2024-09-25', end: '2024-09-29' },
|
|
{ str: 'in 1-5 days', start: '2024-09-25', end: '2024-09-29' },
|
|
{ str: 'in one to five days', start: '2024-09-25', end: '2024-09-29' },
|
|
{ str: '1 to 5 days ago', start: '2024-09-19', end: '2024-09-23' },
|
|
{ str: '1-5 days ago', start: '2024-09-19', end: '2024-09-23' },
|
|
{ str: 'one to five days ago', start: '2024-09-19', end: '2024-09-23' },
|
|
{ str: 'in 1 to 5 weeks', start: '2024-10-01', end: '2024-10-29' },
|
|
{ str: 'in 1-5 weeks', start: '2024-10-01', end: '2024-10-29' },
|
|
{ str: 'in one to five weeks', start: '2024-10-01', end: '2024-10-29' },
|
|
{ str: '1 to 5 weeks ago', start: '2024-08-20', end: '2024-09-17' },
|
|
{ str: '1-5 weeks ago', start: '2024-08-20', end: '2024-09-17' },
|
|
{ str: 'one to five weeks ago', start: '2024-08-20', end: '2024-09-17' },
|
|
{ str: 'in 1 to 5 years', start: '2025-09-24', end: '2029-09-24' },
|
|
{ str: 'in 1-5 years', start: '2025-09-24', end: '2029-09-24' },
|
|
{ str: 'in one to five years', start: '2025-09-24', end: '2029-09-24' },
|
|
{ str: '1 to 5 years ago', start: '2019-09-24', end: '2023-09-24' },
|
|
{ str: '1-5 years ago', start: '2019-09-24', end: '2023-09-24' },
|
|
{ str: 'one to five years ago', start: '2019-09-24', end: '2023-09-24' },
|
|
{ str: 'in 2 to 6 days', start: '2024-09-26', end: '2024-09-30' },
|
|
{ str: 'in 2-6 days', start: '2024-09-26', end: '2024-09-30' },
|
|
{ str: 'in two to six days', start: '2024-09-26', end: '2024-09-30' },
|
|
{ str: '2 to 6 days ago', start: '2024-09-18', end: '2024-09-22' },
|
|
{ str: '2-6 days ago', start: '2024-09-18', end: '2024-09-22' },
|
|
{ str: 'two to six days ago', start: '2024-09-18', end: '2024-09-22' },
|
|
{ str: 'in 2 to 6 weeks', start: '2024-10-08', end: '2024-11-05' },
|
|
{ str: 'in 2-6 weeks', start: '2024-10-08', end: '2024-11-05' },
|
|
{ str: 'in two to six weeks', start: '2024-10-08', end: '2024-11-05' },
|
|
{ str: '2 to 6 weeks ago', start: '2024-08-13', end: '2024-09-10' },
|
|
{ str: '2-6 weeks ago', start: '2024-08-13', end: '2024-09-10' },
|
|
{ str: 'two to six weeks ago', start: '2024-08-13', end: '2024-09-10' },
|
|
{ str: 'in 2 to 6 months', start: '2024-11-24', end: '2025-03-24' },
|
|
{ str: 'in 2-6 months', start: '2024-11-24', end: '2025-03-24' },
|
|
{ str: 'in two to six months', start: '2024-11-24', end: '2025-03-24' },
|
|
{ str: '2 to 6 months ago', start: '2024-03-24', end: '2024-07-24' },
|
|
{ str: '2-6 months ago', start: '2024-03-24', end: '2024-07-24' },
|
|
{ str: 'two to six months ago', start: '2024-03-24', end: '2024-07-24' },
|
|
{ str: 'in 2 to 6 years', start: '2026-09-24', end: '2030-09-24' },
|
|
{ str: 'in 2-6 years', start: '2026-09-24', end: '2030-09-24' },
|
|
{ str: 'in two to six years', start: '2026-09-24', end: '2030-09-24' },
|
|
{ str: '2 to 6 years ago', start: '2018-09-24', end: '2022-09-24' },
|
|
{ str: '2-6 years ago', start: '2018-09-24', end: '2022-09-24' },
|
|
{ str: 'two to six years ago', start: '2018-09-24', end: '2022-09-24' },
|
|
{ str: 'in 4 to 8 days', start: '2024-09-28', end: '2024-10-02' },
|
|
{ str: 'in 4-8 days', start: '2024-09-28', end: '2024-10-02' },
|
|
{ str: 'in four to eight days', start: '2024-09-28', end: '2024-10-02' },
|
|
{ str: '4 to 8 days ago', start: '2024-09-16', end: '2024-09-20' },
|
|
{ str: '4-8 days ago', start: '2024-09-16', end: '2024-09-20' },
|
|
{ str: 'four to eight days ago', start: '2024-09-16', end: '2024-09-20' },
|
|
{ str: 'in 4 to 8 weeks', start: '2024-10-22', end: '2024-11-19' },
|
|
{ str: 'in 4-8 weeks', start: '2024-10-22', end: '2024-11-19' },
|
|
{ str: 'in four to eight weeks', start: '2024-10-22', end: '2024-11-19' },
|
|
{ str: '4 to 8 weeks ago', start: '2024-07-30', end: '2024-08-27' },
|
|
{ str: '4-8 weeks ago', start: '2024-07-30', end: '2024-08-27' },
|
|
{ str: 'four to eight weeks ago', start: '2024-07-30', end: '2024-08-27' },
|
|
{ str: 'in 4 to 8 months', start: '2025-01-24', end: '2025-05-24' },
|
|
{ str: 'in 4-8 months', start: '2025-01-24', end: '2025-05-24' },
|
|
{ str: 'in four to eight months', start: '2025-01-24', end: '2025-05-24' },
|
|
{ str: '4 to 8 months ago', start: '2024-01-24', end: '2024-05-24' },
|
|
{ str: '4-8 months ago', start: '2024-01-24', end: '2024-05-24' },
|
|
{ str: 'four to eight months ago', start: '2024-01-24', end: '2024-05-24' },
|
|
{ str: 'in 4 to 8 years', start: '2028-09-24', end: '2032-09-24' },
|
|
{ str: 'in 4-8 years', start: '2028-09-24', end: '2032-09-24' },
|
|
{ str: 'in four to eight years', start: '2028-09-24', end: '2032-09-24' },
|
|
{ str: '4 to 8 years ago', start: '2016-09-24', end: '2020-09-24' },
|
|
{ str: '4-8 years ago', start: '2016-09-24', end: '2020-09-24' },
|
|
{ str: 'four to eight years ago', start: '2016-09-24', end: '2020-09-24' },
|
|
]
|
|
|
|
|
|
test('duration-ranges', function (t) {
|
|
arr.forEach(obj => {
|
|
const doc = nlp(obj.str)
|
|
const { start, end } = doc.dates(context).get()[0]
|
|
t.equal(start.replace(/T.*/, ''), obj.start, obj.str + ':start')
|
|
t.equal(end.replace(/T.*/, ''), obj.end, obj.str + ':end')
|
|
})
|
|
t.end()
|
|
})
|
|
|