congrats Icon
New! Announcing our next generation AI code completions
Read here
Tabnine Logo
DateTimeAnnotator
Code IndexAdd Tabnine to your IDE (free)

How to use
DateTimeAnnotator
in
coldash.easynlu.parse.annotators

Best Java code snippets using coldash.easynlu.parse.annotators.DateTimeAnnotator (Showing top 2 results out of 315)

origin: kolloldas/EasyNLU

@Override
public List<Rule> annotate(List<String> tokens) {
  if(tokens.size() == 1) {
    String s = tokens.get(0).toLowerCase();
    Rule r = parseMonth(s);
    if(r == null)
      r = parseDay(s);
    if(r == null)
      r = parseTime(s);
    if(r != null)
      return Collections.singletonList(r);
    else
      return parseNumber(s);
  }
  return Collections.emptyList();
}
origin: kolloldas/EasyNLU

public static Model makeReminderModel(){
  List<Rule> rules = new LinkedList<>();
  rules.addAll(Rules.BASE);
  rules.addAll(Rules.fromFile("model/reminders.rules"));
  rules.addAll(DateTimeAnnotator.rules());
  List<Annotator> annotators = Arrays.asList(
      TokenAnnotator.INSTANCE,
      PhraseAnnotator.INSTANCE,
      NumberAnnotator.INSTANCE,
      DateTimeAnnotator.INSTANCE
  );
  Grammar grammar = new Grammar(rules, "$ROOT");
  Parser parser = new Parser(grammar, new BasicTokenizer(), annotators);
  return new Model(parser);
}
coldash.easynlu.parse.annotatorsDateTimeAnnotator

Javadoc

Date Annotator 1/12/17 -> $Date 01/02/2018 -> $Date 1-2-2018 -> $Date 3rd May -> $DateDay $DateMonth today -> $DateDay yesterday -> $DateDay 2 days back/ago -> $Number $Day $Ago last Sunday -> $Previous $DateDow wednesday -> $DateDow 1st of March -> $DateDay $Of $DateMonth 10th June -> $DateDay $DateMonth June 10 2016 -> $DateMonth $Number $Number 2.3.96 -> $Date 29 June 2003 -> $Number $DateMonth $NUmber 4th of July -> $DateDay $Of $DateMonth Mon -> $DateDow May the 13th -> $DateMonth $The $DateDay Nov 7 1972 -> $DateMonth $Number $Number

Most used methods

  • parseDay
  • parseMonth
  • parseNumber
  • parseTime
  • rules

Popular in Java

  • Making http requests using okhttp
  • requestLocationUpdates (LocationManager)
  • getSystemService (Context)
  • setRequestProperty (URLConnection)
  • Font (java.awt)
    The Font class represents fonts, which are used to render text in a visible way. A font provides the
  • EOFException (java.io)
    Thrown when a program encounters the end of a file or stream during an input operation.
  • PrintStream (java.io)
    Fake signature of an existing Java class.
  • Deque (java.util)
    A linear collection that supports element insertion and removal at both ends. The name deque is shor
  • LinkedHashMap (java.util)
    LinkedHashMap is an implementation of Map that guarantees iteration order. All optional operations a
  • PriorityQueue (java.util)
    A PriorityQueue holds elements on a priority heap, which orders the elements according to their natu
  • PhpStorm for WordPress
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now