Package info.bethard.timenorm

Examples of info.bethard.timenorm.TimeSpan


   */
  public static Set<TemporalUnit> runTimexParser(String timex) {

    URL grammarURL = DurationEventTimeFeatureExtractor.class.getResource("/info/bethard/timenorm/en.grammar");
    TemporalExpressionParser parser = new TemporalExpressionParser(grammarURL);
    TimeSpan anchor = TimeSpan.of(2013, 12, 16);
    Try<Temporal> result = parser.parse(timex, anchor);

    Set<TemporalUnit> units = null;
    if (result.isSuccess()) {
      Temporal temporal = result.get();
View Full Code Here


      if (!matcher.find()) {
        System.err.println(goldView.getDocumentText());
      } else {
        Try<Temporal> anchorTry = parser.parse(matcher.group(1), TimeSpan.of(1, 1, 1));
        if (anchorTry.isSuccess() && anchorTry.get() instanceof TimeSpan) {
          TimeSpan anchor = (TimeSpan)anchorTry.get();
          for (Segment segment : JCasUtil.select(jCas, Segment.class)) {
            if (!THYMEData.SEGMENTS_TO_SKIP.contains(segment.getId())) {
              for (TimeMention time : JCasUtil.selectCovered(goldView, TimeMention.class, segment)) {
                String timeText = time.getCoveredText();
                Try<Temporal> parsedTime = parser.parse(timeText, anchor);
View Full Code Here

TOP

Related Classes of info.bethard.timenorm.TimeSpan

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.