Package org.apache.tika.language.translate

Examples of org.apache.tika.language.translate.MicrosoftTranslator


import org.apache.tika.language.translate.MicrosoftTranslator;

public class TranslatorExample {
    public String microsoftTranslateToFrench(String text) {
        MicrosoftTranslator translator = new MicrosoftTranslator();
        // Change the id and secret! See http://msdn.microsoft.com/en-us/library/hh454950.aspx.
        translator.setId("dummy-id");
        translator.setSecret("dummy-secret");
        try {
            return translator.translate(text, "fr");
        } catch (Exception e) {
            return "Error while translating.";
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.tika.language.translate.MicrosoftTranslator

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.