|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.tika.language.LanguageIdentifier
public class LanguageIdentifier
Identifier of the language that best matches a given content profile. The content profile is compared to generic language profiles based on material from various sources.
Constructor Summary | |
---|---|
LanguageIdentifier(LanguageProfile profile)
Constructs a language identifier based on a LanguageProfile |
|
LanguageIdentifier(java.lang.String content)
Constructs a language identifier based on a String of text content |
Method Summary | |
---|---|
static void |
addProfile(java.lang.String language,
LanguageProfile profile)
Adds a single language profile |
static void |
clearProfiles()
Clears the current map of language profiles |
static java.lang.String |
getErrors()
Returns a string of error messages related to initializing langauge profiles |
java.lang.String |
getLanguage()
Gets the identified language |
static java.util.Set<java.lang.String> |
getSupportedLanguages()
Returns what languages are supported for language identification |
static boolean |
hasErrors()
Tests whether there were errors initializing language config |
static void |
initProfiles()
Builds the language profiles. |
static void |
initProfiles(java.util.Map<java.lang.String,LanguageProfile> profilesMap)
Initializes the language profiles from a user supplied initialized Map. |
boolean |
isReasonablyCertain()
Tries to judge whether the identification is certain enough to be trusted. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public LanguageIdentifier(LanguageProfile profile)
profile
- the language profilepublic LanguageIdentifier(java.lang.String content)
content
- the textMethod Detail |
---|
public static void addProfile(java.lang.String language, LanguageProfile profile)
language
- an ISO 639 code representing languageprofile
- the language profilepublic java.lang.String getLanguage()
public boolean isReasonablyCertain()
true
if the distance is smaller then , false
otherwisepublic static void initProfiles()
public static void initProfiles(java.util.Map<java.lang.String,LanguageProfile> profilesMap)
profilesMap
- map of language profilespublic static void clearProfiles()
public static boolean hasErrors()
public static java.lang.String getErrors()
public static java.util.Set<java.lang.String> getSupportedLanguages()
public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |