wanasit / chrono

A natural language date parser in Javascript
MIT License
4.6k stars 341 forks source link

Incorrect Parsing of "the money" as a Date #554

Closed ilDon closed 5 months ago

ilDon commented 6 months ago

Chrono incorrectly parses the phrase "the money" as a date in the sentence "do I have the money".

Environment

Steps to Reproduce

  1. Configure a new chrono instance with default settings:
    const configuration = chrono.casual.defaultConfig.createCasualConfiguration(false);
    const chronoInstance = new chrono.Chrono(configuration);
    const forwardFrom = options?.forwardFrom || new Date();
  2. Parse the sentence "do I have the money" with the following settings:
    const result = chronoInstance.parse('do I have the money', {
      forwardDate: true,
      startDayHour: 8
    });

    Expected result: No date should be recognized. Actual result: "the money" is incorrectly parsed as a date.

Expected Behavior

The parser should recognize that "the money" is not a date and should not return any date-related information for the given sentence.

Actual Behavior

The parser incorrectly identifies "the money" as a date.

wanasit commented 5 months ago

I cannot reproduce this issue. Could you take a look at the test I added in c5ebdd57cab0d956a6a2a6aa7bde0b018d008e38?