Skip to content
master
Go to file
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
src
 
 
 
 
 
 
 
 
 
 
 
 

README.md

Detect Language API Java Client

Maven metadata URI Build Status

Detects language of the given text. Returns detected language codes and scores.

Installation

Maven

Add this dependency to your pom.xml:

<dependency>
    <groupId>com.detectlanguage</groupId>
    <artifactId>detectlanguage</artifactId>
    <version>1.1.0</version>
</dependency>

Gradle

Add this dependency to your build.gradle:

repositories {
	mavenCentral()
}

dependencies {
	compile 'com.detectlanguage:detectlanguage:1.1.0'
}

Usage

import com.detectlanguage.DetectLanguage;

Configuration

Before using Detect Language API client you have to setup your personal API key. You can get it by signing up at https://detectlanguage.com

DetectLanguage.apiKey = "YOURAPIKEY";

// Enable secure mode (SSL) if passing sensitive information
// DetectLanguage.ssl = true;

Language detection

List<Result> results = DetectLanguage.detect("Hello world");

Result result = results.get(0);

System.out.println("Language: " + result.language);
System.out.println("Is reliable: " + result.isReliable);
System.out.println("Confidence: " + result.confidence);

Simple detection

String language = DetectLanguage.simpleDetect("Hello world");

Batch detection

String[] texts = {
	"Hello world",
	"Labas rytas"
};

List<List<Result>> results = DetectLanguage.detect(texts);

Requirements

Which you can download to target/dependency using:

mvn dependency:copy-dependencies

Issues

Please use appropriately tagged github issues to request features or report bugs.

Testing

mvn test

Publishing

Sonatype OSS repository.

Snapshot

mvn clean deploy

Stage Release

mvn release:clean
mvn release:prepare
mvn release:perform

Release

Done using the Sonatype Nexus UI.

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Write your code and tests
  4. Ensure all tests still pass
  5. Commit your changes (git commit -am 'Add some feature')
  6. Push to the branch (git push origin my-new-feature)
  7. Create new pull request

About

Detect Language API Java Client

Topics

Resources

License

Packages

No packages published

Languages

You can’t perform that action at this time.