Coder Social home page Coder Social logo

bryant1410 / microsoft-translator-java-api Goto Github PK

View Code? Open in Web Editor NEW

This project forked from boatmeme/microsoft-translator-java-api

0.0 1.0 0.0 214 KB

Java wrapper for the Microsoft Translator API

Home Page: http://code.google.com/p/microsoft-translator-java-api/

License: Apache License 2.0

Java 100.00%

microsoft-translator-java-api's Introduction

microsoft-translator-java-api


Provides a Java wrapper around the Microsoft Translator API aka Bing Translator.

Created in an attempt to fill the void left by the deprecation of the Google Translate API announced on May 26, 2011 and scheduled for permanent shutdown on December 1, 2011.

In an effort to lessen the impact on Java developers that have previously integrated the Google Translate API into their applications, it is my goal to mimic the code structure, naming conventions, functionality, and usage patterns of the excellent and widely used google-api-translate-java by Rich Midwinter.

Requires

  • Java 1.5 or greater
  • A Windows Azure Marketplace Client ID and Client Secret - Documentation

Please note: If you signed up for a Bing Developer Key after March 31, 2012, you will not be able to use your App Id with this API. Please visit the aforementioned documentation link

Quickstart

Download the latest JAR with Dependencies

import com.memetix.mst.language.Language;
import com.memetix.mst.translate.Translate;

public class Main {
  public static void main(String[] args) throws Exception {
    // Set your Windows Azure Marketplace client info - See http://msdn.microsoft.com/en-us/library/hh454950.aspx
    Translate.setClientId(/* Enter your Windows Azure Client Id here */);
    Translate.setClientSecret(/* Enter your Windows Azure Client Secret here */);

    String translatedText = Translate.execute("Bonjour le monde", Language.FRENCH, Language.ENGLISH);

    System.out.println(translatedText);
  }
}

More Examples

I've posted some examples to the SVN repository on Google Code. The examples include:

Maven

For those using Maven 2 to manage their project dependencies, the microsoft-translator-java-api is distributed via the Maven Central repository. Simply include the following in your POM.xml to use the Microsoft Translator Java API:

<dependency>
    <groupId>com.memetix</groupId>
    <artifactId>microsoft-translator-java-api</artifactId>
    <version>0.6.2</version>
    <type>jar</type>
</dependency>

Or, if you're feeling adventurous, help us test the next version by adding the latest SNAPSHOT to your POM.xml:

<dependency>
    <groupId>com.memetix</groupId>
    <artifactId>microsoft-translator-java-api</artifactId>
    <version>0.7-SNAPSHOT</version>
    <type>jar</type>
</dependency>

The SNAPSHOT is hosted at the Sonatype OSS Snapshot repository, so if you do not already have it in your repository list, you will need to add this also

<repository>
    <id>sonatype-oss-repo</id>
    <name>Sonatype Open Source maven snapshot repo</name>
    <url>https://oss.sonatype.org/content/repositories/snapshots/</url>
</repository>

License

The microsoft-translator-java-api is licensed under the Apache License, Version 2.0

/*
 * Copyright 2011-2015 Jonathan Griggs.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

Please note that while this license does not distinguish between personal, internal or commercial use, the Microsoft Translator API itself does in fact make this distinction.

If you intend to use the Microsoft Translator API for commercial or high volume purposes, you would need to sign a commercial license agreement and provide your appID to the Microsoft Translator team. For more details contact [email protected]. This allows the Microsoft Translator team to better tune the service to the needs of our many partners, and avoid abuse.

microsoft-translator-java-api's People

Contributors

boatmeme avatar bryant1410 avatar rmtheis avatar

Watchers

 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.