Package com.mdimension.jchronic.repeaters

Examples of com.mdimension.jchronic.repeaters.EnumRepeaterDayPortion


      if (RepeaterDayPortion.DayPortion.MORNING.equals(t1TagType)) {
        if (options.isDebug()) {
          System.out.println("Chronic.dealiasAndDisambiguateTimes: morning->am");
        }
        t1.untag(RepeaterDayPortion.class);
        t1.tag(new EnumRepeaterDayPortion(RepeaterDayPortion.DayPortion.AM));
      }
      else if (RepeaterDayPortion.DayPortion.AFTERNOON.equals(t1TagType) || RepeaterDayPortion.DayPortion.EVENING.equals(t1TagType) || RepeaterDayPortion.DayPortion.NIGHT.equals(t1TagType)) {
        if (options.isDebug()) {
          System.out.println("Chronic.dealiasAndDisambiguateTimes: " + t1TagType + "->pm");
        }
        t1.untag(RepeaterDayPortion.class);
        t1.tag(new EnumRepeaterDayPortion(RepeaterDayPortion.DayPortion.PM));
      }
    }

//    int tokenSize = tokens.size();
//    for (int i = 0; i < tokenSize; i++) {
View Full Code Here


    // affect wanted patterns
    tokens.add(new Token("5:00"));
    tokens.add(new Token("morning"));
    tokens.get(0).tag(new RepeaterTime("5:00"));
    tokens.get(1).tag(new EnumRepeaterDayPortion(RepeaterDayPortion.DayPortion.MORNING));

    assertEquals(RepeaterDayPortion.DayPortion.MORNING, tokens.get(1).getTags().get(0).getType());

    tokens = Handler.dealiasAndDisambiguateTimes(tokens, new Options());

    assertEquals(RepeaterDayPortion.DayPortion.AM, tokens.get(1).getTags().get(0).getType());
    assertEquals(2, tokens.size());

    // don't affect unwanted patterns
    tokens = new LinkedList<Token>();
    tokens.add(new Token("friday"));
    tokens.add(new Token("morning"));
    tokens.get(0).tag(new RepeaterDayName(DayName.FRIDAY));
    tokens.get(1).tag(new EnumRepeaterDayPortion(RepeaterDayPortion.DayPortion.MORNING));

    assertEquals(RepeaterDayPortion.DayPortion.MORNING, tokens.get(1).getTags().get(0).getType());

    tokens = Handler.dealiasAndDisambiguateTimes(tokens, new Options());
View Full Code Here

    tokens.get(0).tag(new RepeaterDayName(RepeaterDayName.DayName.FRIDAY));
   
    assertTrue(handler.match(tokens, Handler.definitions()));
   
    tokens.add(new Token("afternoon"));
    tokens.get(1).tag(new EnumRepeaterDayPortion(RepeaterDayPortion.DayPortion.AFTERNOON));
   
    assertFalse(handler.match(tokens, Handler.definitions()));
  }
View Full Code Here

    tokens.get(0).tag(new RepeaterDayName(RepeaterDayName.DayName.FRIDAY));
   
    assertTrue(handler.match(tokens, Handler.definitions()));
   
    tokens.add(new Token("afternoon"));
    tokens.get(1).tag(new EnumRepeaterDayPortion(RepeaterDayPortion.DayPortion.AFTERNOON));
   
    assertTrue(handler.match(tokens, Handler.definitions()));
   
    tokens.add(new Token("afternoon"));
    tokens.get(2).tag(new EnumRepeaterDayPortion(RepeaterDayPortion.DayPortion.AFTERNOON));
   
    assertFalse(handler.match(tokens, Handler.definitions()));
  }
View Full Code Here

    tokens.get(0).tag(new RepeaterDayName(RepeaterDayName.DayName.FRIDAY));
   
    assertTrue(handler.match(tokens, Handler.definitions()));
   
    tokens.add(new Token("afternoon"));
    tokens.get(1).tag(new EnumRepeaterDayPortion(RepeaterDayPortion.DayPortion.AFTERNOON));
   
    assertFalse(handler.match(tokens, Handler.definitions()));
  }
View Full Code Here

    tokens.get(1).tag(new RepeaterTime("5:00"));
   
    assertTrue(handler.match(tokens, Handler.definitions()));
   
    tokens.add(new Token("pm"));
    tokens.get(2).tag(new EnumRepeaterDayPortion(RepeaterDayPortion.DayPortion.PM));
   
    assertTrue(handler.match(tokens, Handler.definitions()));
  }
View Full Code Here

TOP

Related Classes of com.mdimension.jchronic.repeaters.EnumRepeaterDayPortion

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.