Codota Logo
DateTimeAnnotator
Code IndexAdd Codota 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)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
Gson g =
  • Codota Iconnew Gson()
  • Codota IconGsonBuilder gsonBuilder;gsonBuilder.create()
  • Codota Iconnew GsonBuilder().create()
  • Smart code suggestions by Codota
}
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

  • Finding current android device location
  • notifyDataSetChanged (ArrayAdapter)
  • getApplicationContext (Context)
  • getSharedPreferences (Context)
  • BufferedReader (java.io)
    Reads text from a character-input stream, buffering characters so as to provide for the efficient re
  • HttpURLConnection (java.net)
    An URLConnection for HTTP (RFC 2616 [http://tools.ietf.org/html/rfc2616]) used to send and receive d
  • JList (javax.swing)
  • XPath (javax.xml.xpath)
    XPath provides access to the XPath evaluation environment and expressions. Evaluation of XPath Expr
  • Base64 (org.apache.commons.codec.binary)
    Provides Base64 encoding and decoding as defined by RFC 2045.This class implements section 6.8. Base
  • Get (org.apache.hadoop.hbase.client)
    Used to perform Get operations on a single row. To get everything for a row, instantiate a Get objec
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now