public String getLanguage ( String text ) { String language = null ; TextObject textObject = textObjectFactory . forText ( text ) ; com . google . common . base . Optional < LdLocale > lang = languageDetector . detect ( textObject ) ; if ( lang . isPresent ( ) ) { language = lang . get ( ) . toString ( ) ; } return language ; }
Get language from string