Package edu.stanford.nlp.ie.pascal

Examples of edu.stanford.nlp.ie.pascal.ISODateInstance


        // this is a relative date, e.g., "yesterday"
        return timexFromSUTime.altVal();
      }
    }

    ISODateInstance d = new ISODateInstance(s, openRangeMarker);
    if (DEBUG2) err.println("normalizeDate: " + s + " to " + d.getDateString());
    return (d.getDateString());
  }
View Full Code Here


            if (next.get(CoreAnnotations.TextAnnotation.class).matches(ranges.second()) && nerNext2 != null && nerNext2.equals(curNER)) {
              //Add rest in
              prev.set(CoreAnnotations.PartOfSpeechAnnotation.class, "QUANT_MOD");
              String rangeString;
              if(curNER.equals("DATE")) {
                ISODateInstance c = new ISODateInstance(new ISODateInstance(firstDate.get(CoreAnnotations.NormalizedNamedEntityTagAnnotation.class)),
                    new ISODateInstance(next2.get(CoreAnnotations.NormalizedNamedEntityTagAnnotation.class)));
                rangeString = c.getDateString();
              } else {
                rangeString = firstDate.get(CoreAnnotations.NormalizedNamedEntityTagAnnotation.class) + '-' + next2.get(CoreAnnotations.NormalizedNamedEntityTagAnnotation.class);
              }
              if (DEBUG) {
                System.err.println("#1: Changing normalized NER from " + firstDate.get(CoreAnnotations.NormalizedNamedEntityTagAnnotation.class) + " to " + rangeString + " at index " + beforeIndex);
View Full Code Here

              int first = Integer.parseInt(sides[0]);
              int second = Integer.parseInt(sides[1]);
              //they're both integers, see if they're both between 1000-3000 (likely years)
              if (1000 <= first && first <= 3000 && 1000 <= second && second <= 3000) {
                wi.set(CoreAnnotations.NamedEntityTagAnnotation.class, "DATE");
                String dateStr = new ISODateInstance(new ISODateInstance(sides[0]), new ISODateInstance(sides[1])).getDateString();
                if (DEBUG) {
                  System.err.println("#5: Changing normalized NER from " +
                          wi.get(CoreAnnotations.NormalizedNamedEntityTagAnnotation.class) + " to " + dateStr + " at index " + i);
                }
                wi.set(CoreAnnotations.NormalizedNamedEntityTagAnnotation.class, dateStr);
View Full Code Here

TOP

Related Classes of edu.stanford.nlp.ie.pascal.ISODateInstance

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.