com.memetix.mst.sentence
Class BreakSentences

java.lang.Object
  extended by com.memetix.mst.MicrosoftTranslatorAPI
      extended by com.memetix.mst.sentence.BreakSentences

public final class BreakSentences
extends MicrosoftTranslatorAPI

BreakSentences Provides an interface to the Microsoft Translator BreakSentences service This service is basically a utility for determining how Microsoft Translator is interpreting sentence breaks within a given string of text Uses the AJAX Interface V2 - see: http://msdn.microsoft.com/en-us/library/ff512395.aspx

Author:
Jonathan Griggs

Field Summary
 
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
 
Method Summary
static Integer[] execute(String text, Language fromLang)
          Reports the number of sentences detected and the length of those sentences
 
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
 

Method Detail

execute

public static Integer[] execute(String text,
                                Language fromLang)
                         throws Exception
Reports the number of sentences detected and the length of those sentences

Parameters:
text - The String to break into sentences
fromLang - The Language of origin
Returns:
an array of integers representing the size of each detected sentence
Throws:
Exception - on error.


Copyright © 2012. All Rights Reserved.