Jyandex

A Java client library for Yandex Translate service.

License

License

Categories

Categories

Dex General Purpose Libraries Utility
GroupId

GroupId

co.aurasphere
ArtifactId

ArtifactId

jyandex
Last Version

Last Version

1.0.0
Release Date

Release Date

Type

Type

jar
Description

Description

Jyandex
A Java client library for Yandex Translate service.
Project URL

Project URL

https://github.com/aurasphere/jyandex
Project Organization

Project Organization

Aurasphere
Source Code Management

Source Code Management

https://github.com/aurasphere/jyandex

Download jyandex

How to add to project

<!-- https://jarcasting.com/artifacts/co.aurasphere/jyandex/ -->
<dependency>
    <groupId>co.aurasphere</groupId>
    <artifactId>jyandex</artifactId>
    <version>1.0.0</version>
</dependency>
// https://jarcasting.com/artifacts/co.aurasphere/jyandex/
implementation 'co.aurasphere:jyandex:1.0.0'
// https://jarcasting.com/artifacts/co.aurasphere/jyandex/
implementation ("co.aurasphere:jyandex:1.0.0")
'co.aurasphere:jyandex:jar:1.0.0'
<dependency org="co.aurasphere" name="jyandex" rev="1.0.0">
  <artifact name="jyandex" type="jar" />
</dependency>
@Grapes(
@Grab(group='co.aurasphere', module='jyandex', version='1.0.0')
)
libraryDependencies += "co.aurasphere" % "jyandex" % "1.0.0"
[co.aurasphere/jyandex "1.0.0"]

Dependencies

compile (2)

Group / Artifact Type Version
org.glassfish.jersey.core : jersey-client jar 2.23.2
org.glassfish.jersey.media : jersey-media-json-jackson jar 2.22

test (1)

Group / Artifact Type Version
junit : junit jar 4.12

Project Modules

There are no modules declared in this project.

Travis Maven Central Javadocs Maintainability Test Coverage Join the chat at https://gitter.im/jyandex/Lobby Donate

Jyandex

A Java library client for Yandex Translate service.

This library offers three services: text translation, text language detection and available languages for translation. You will need a free API key in order to use the Yandex API.

Warning

Starting from August 15, 2020, free API keys aren't issued. For this reason, this project is not tested/maintained anymore.

Sample Usage

Dependency

Maven:

<dependency>
    <groupId>co.aurasphere</groupId>
    <artifactId>jyandex</artifactId>
    <version>1.0.0</version>
</dependency>

Gradle:

implementation 'co.aurasphere:jyandex:1.0.0'

Create a client

Jyandex client = new Jyandex(apiKey);

(you can get a free API key here).

Translate text

Translate a sentence to Italian:

client.translateText(textToTranslate, Language.ITALIAN);

If you know the original language, you can pass it as an argument for better results (otherwise the language will be guessed). In this case, we are translating an English sentence into Italian:

client.translateText(textToTranslate, Language.ENGLISH, Language.ITALIAN);

Detect language

Detect the language of a sentence:

client.detectLanguage(textToDetect);

You can also pass a list of most-likely languages as hint:

List<String> hint = Arrays.asList(Language.JAPANESE, Language.ITALIAN, Language.AFRIKAANS);
client.detectLanguage(textToDetect, hint);

Supported languages

Get a list of supported languages from Yandex in English:

client.supportedLanguages();

If you want to display the list in another language (Italian in this case):

client.supportedLanguages(Language.ITALIAN);

Useful links

Contributions

If you want to contribute on this project, just fork this repo and submit a pull request with your changes. Improvements are always appreciated!

Project status

This project is considered completed and won't be developed further unless I get any specific requests.

Contacts

You can contact me using my account e-mail or opening an issue on this repo. I'll try to reply back ASAP.

License

The project is released under the MIT license, which lets you reuse the code for any purpose you want (even commercial) with the only requirement being copying this project license on your project.

Copyright (c) 2016 Donato Rimenti

Versions

Version
1.0.0