Skip to content

AYLIEN's officially supported Java client library for accessing Text API

License

Notifications You must be signed in to change notification settings

kaleida/aylien_textapi_java

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

37 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

About

This is the Java client library for AYLIEN's APIs. If you haven't already done so, you will need to sign up.

Installation

Maven users

Add this dependency to your project's POM:

<dependency>
  <groupId>com.aylien.textapi</groupId>
  <artifactId>client</artifactId>
  <version>0.5.1</version>
</dependency>

sbt users

Add this to your libraryDependencies:

"com.aylien.textapi" % "client" % "0.5.1"

See the Developers Guide for additional documentation.

Example

import com.aylien.textapi.TextAPIClient;
import com.aylien.textapi.parameters.*;
import com.aylien.textapi.responses.*;
import java.net.URL;

class Example {
  public static void main(String[] args) throws Exception {
    TextAPIClient client = new TextAPIClient("YourApplicationId", "YourApplicationKey");
    ConceptsParams.Builder builder = ConceptsParams.newBuilder();
    builder.setUrl(new URL("http://www.bbc.com/news/science-environment-30097648"));
    Concepts concepts = client.concepts(builder.build());
    System.out.println(concepts.getText());
    for (Concept c: concepts.getConcepts()) {
      System.out.println(c.getUri());
      for (SurfaceForm sf: c.getSurfaceForms()) {
        System.out.println(sf.getString());
      }
    }
  }
}

About

AYLIEN's officially supported Java client library for accessing Text API

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Java 100.0%