Skip to content

Usage Workflows

Saeed Masoumi edited this page Mar 13, 2017 · 1 revision

Getting started with ApexNLP is easy:

  1. Include the needed dependencies. (follow this instruction)
  2. Use the Apex class to initialize and parse your input sentence.

What is Apex class?

Apex is a wrapper class around all messy stuff we did to convert your given sentence to an Event class. It has just two methods:

  • Apex#init(ApexConfig config): You should call this method just once during your application lifecycle. You can use ApexBuilder to pass the needed config. Here is an example:
Apex.init(new Apex.ApexBuilder()
                .addParser("en", new EnglishParser())
                   .build()); 

Out-of-the-box, ApexNLP expects and processes English language text. But, it was designed to work with multiple human languages. So we introduce Parsers, Each Parser parse your input sentence of an individual language to an Event class.

  • Apex#nlp(String parserName, String sentence): This method will give two parameters, the name of your interested Parser, and the input sentence and returns an Event class. Here is an example:
Apex.nlp("en","Lunch at noon for 30 minutes");

And it will return:

{
"title" : "Lunch",
"location" : "",
"startDateTime" : "2017/4/13 12:00",
"endDateTime" : "2017/4/13 12:30",
"isAllDay" : false,
"recurrence" : null
}
Clone this wiki locally