CoreNLP icon indicating copy to clipboard operation
CoreNLP copied to clipboard

Sutime handling custom formats

Open oldmonkABA opened this issue 4 years ago • 0 comments

I am using Corenlp for extracting dates from the text. I want to extract the format : Nov-02-1990. Corenlp is able to extract Nov 01 1990 but fails with hyphens

In english.sutime.txt I added the following rules

 MONTH_MAP = {
      "jan": 1,
      "feb": 2,
      "mar": 3,
      "apr": 4,
      "may": 5,
      "jun": 6,
      "jul": 7,
      "aug": 8,
      "sep": 9,
      "oct": 10,
      "nov": 11,
      "dec": 12
    }
   $MONTH_NAME = CreateRegex(Keys(MONTH_MAP))

{
     ruleType: "text",
     pattern: ( (/($MONTH_NAME)[-]([0-9]{2})[-]([0-9]{4})/) ),
     result: IsoDate($3, MONTH_MAP[Lowercase($1)] , $2)
    
   }

I am getting the following error:

edu.stanford.nlp.util.ReflectionLoading$ReflectionLoadingException: Error creating edu.stanford.nlp.time.TimeExpressionExtractorImpl

What should i do?

oldmonkABA avatar Sep 25 '20 05:09 oldmonkABA