com.memetix.mst.detect
Class Detect
java.lang.Object
com.memetix.mst.MicrosoftTranslatorAPI
com.memetix.mst.detect.Detect
public final class Detect
- extends MicrosoftTranslatorAPI
Detect
Provides an interface to the Microsoft Translator Detect service method
Uses the AJAX Interface V2 - see: http://msdn.microsoft.com/en-us/library/ff512396.aspx
- Author:
- Jonathan Griggs
| Fields inherited from class com.memetix.mst.MicrosoftTranslatorAPI |
apiKey, ENCODING, PARAM_APP_ID, PARAM_FROM_LANG, PARAM_LANGUAGE_CODES, PARAM_LOCALE, PARAM_SENTENCES_LANGUAGE, PARAM_SPOKEN_LANGUAGE, PARAM_TEXT_ARRAY, PARAM_TEXT_SINGLE, PARAM_TO_LANG |
| Methods inherited from class com.memetix.mst.MicrosoftTranslatorAPI |
buildStringArrayParam, getToken, retrieveIntArray, retrieveString, retrieveStringArr, retrieveStringArr, setClientId, setClientSecret, setContentType, setHttpReferrer, setKey, validateServiceState |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
execute
public static Language execute(String text)
throws Exception
- Detects the language of a supplied String.
- Parameters:
text - The String to detect the language of.
- Returns:
- A String containing the language
- Throws:
Exception - on error.
execute
public static String[] execute(String[] texts)
throws Exception
- Detects the language of all supplied Strings in array.
- Parameters:
text - The Strings to detect the language of.
- Returns:
- A String array containing the detected languages
- Throws:
Exception - on error.
Copyright © 2012. All Rights Reserved.