Code Monkey home page Code Monkey logo

detectlanguage-java's Introduction

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

detectlanguage-java's People

Contributors

laurynas avatar reedniv avatar dependabot[bot] avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.