<commit_before>#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](http://googlecode.blogspot.com/2011/05/spring-cleaning-for-some-of-our-apis.html) of the [Google Translate API](http://code.google.com/apis/language/translate/overview.html) 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](https://github.com/richmidwinter/google-api-translate-java) by <NAME>.

## Requires

* A Bing Developer API Key - [Sign Up Here](http://www.bing.com/developers/createapp.aspx)

Quickstart:
===========

Download the latest [JAR with Dependencies](https://github.com/downloads/boatmeme/microsoft-translator-java-api/microsoft-translator-java-api-0.3-jar-with-dependencies.jar)

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

    public class Main {
      public static void main(String[] args) throws Exception {
        // Set the Microsoft Translator API Key - Get yours at http://www.bing.com/developers/createapp.aspx
        Translate.setKey(/* Enter your API Key here */);

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

        System.out.println(translatedText);
      }
    }

Maven
=====
Include the following in your POM.xml:

    <dependency>
        <groupId>com.memetix</groupId>
        <artifactId>microsoft-translator-java-api</artifactId>
        <version>0.3</version>
        <type>jar</type>
    </dependency><commit_msg>Added links to More Examples and SNAPSHOT dependency XML<commit_after>#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](http://googlecode.blogspot.com/2011/05/spring-cleaning-for-some-of-our-apis.html) of the [Google Translate API](http://code.google.com/apis/language/translate/overview.html) 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](https://github.com/richmidwinter/google-api-translate-java) by <NAME>.

## Requires

* A Bing Developer API Key - [Sign Up Here](http://www.bing.com/developers/createapp.aspx)

Quickstart:
===========

Download the latest [JAR with Dependencies](https://github.com/downloads/boatmeme/microsoft-translator-java-api/microsoft-translator-java-api-0.3-jar-with-dependencies.jar)

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

    public class Main {
      public static void main(String[] args) throws Exception {
        // Set the Microsoft Translator API Key - Get yours at http://www.bing.com/developers/createapp.aspx
        Translate.setKey(/* Enter your API Key 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 [http://code.google.com/p/microsoft-translator-java-api/source/browse/#svn%2Ftrunk%2Fmicrosoft-translator-java-examples%2Fsrc%2Fmain%2Fjava%2Fcom%2Fmemetix%2Fmst%2Fexamples] (SVN repository) on Google Code. The examples include:

  * [http://code.google.com/p/microsoft-translator-java-api/source/browse/trunk/microsoft-translator-java-examples/src/main/java/com/memetix/mst/examples/TranslateExample.java] (Translating text between two languages)
  * [http://code.google.com/p/microsoft-translator-java-api/source/browse/trunk/microsoft-translator-java-examples/src/main/java/com/memetix/mst/examples/DetectLanguageExample.java] (Detecting the native language of given text)
  * [http://code.google.com/p/microsoft-translator-java-api/source/browse/trunk/microsoft-translator-java-examples/src/main/java/com/memetix/mst/examples/LanguageLocalizationExamples.java] (Getting a list of supported languages, with localized language names)
  * [http://code.google.com/p/microsoft-translator-java-api/source/browse/trunk/microsoft-translator-java-examples/src/main/java/com/memetix/mst/examples/SpeakTextExample.java] (Generating and playing a WAV of given text spoken in a chosen dialect)

Maven
=====

For those using Maven 2 to manage their project dependencies, the microsoft-translator-java-api is distributed via the [http://search.maven.org/#browse%7C458759702] (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.3</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.4-SNAPSHOT</version>
        <type>jar</type>
    </dependency>

The snapshot is hosted at the [https://oss.sonatype.org/content/repositories/snapshots/](OSS Sonatype Snapshot) repository
{'fraction_non_alphanumeric': 0.11476544919508395, 'fraction_numerical': 0.011078414401938722, 'mean_word_length': 4.200720072007201, 'pattern_counts': {'":': 0, '<': 35, '<?xml version=': 0, '>': 35, 'https://': 5, 'lorem ipsum': 0, 'www.': 4, 'xml': 3}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4342537', 'n_tokens_mistral': 1832, 'n_tokens_neox': 1668, 'n_words': 438}