public String detect() throws LangDetectException {
  ArrayList<Language> probabilities=getProbabilities();
  if (probabilities.size() > 0)   return probabilities.get(0).lang;
  return UNKNOWN_LANG;
}

public String detect ( ) throws LangDetectException { ArrayList < Language > probabilities = getProbabilities ( ) ; if ( probabilities . size ( ) > 0 ) return probabilities . get ( 0 ) . lang ; return UNKNOWN_LANG ; }
detect language of the target text and return the language name which has the highest probability .
