edu.northwestern.at.morphadorner.corpuslinguistics.languagerecognizer

## Class CybozuLabsLanguageRecognizer

- java.lang.Object
- - edu.northwestern.at.utils.IsCloseableObject
  - - edu.northwestern.at.morphadorner.corpuslinguistics.languagerecognizer.AbstractLanguageRecognizer
    - - edu.northwestern.at.morphadorner.corpuslinguistics.languagerecognizer.CybozuLabsLanguageRecognizer

- All Implemented Interfaces:
    LanguageRecognizer, UsesLogger
  Direct Known Subclasses:
    DefaultLanguageRecognizer

      public class CybozuLabsLanguageRecognizer
      extends AbstractLanguageRecognizer

  Cybozu Labs Language Recognizer.

- - ### Field Summary

    - ### Fields inherited from class edu.northwestern.at.morphadorner.corpuslinguistics.languagerecognizer.AbstractLanguageRecognizer

      `logger`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `CybozuLabsLanguageRecognizer()` Create a language recognizer with the default language profiles.
    `CybozuLabsLanguageRecognizer(java.util.List<java.lang.String> languages)` Create a language recognizer with list of languages to recognize.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `java.util.List<java.lang.String>` | `getAvailableLanguageProfileNames()` Get list of available languages for detection.
    `static java.util.List<java.lang.String>` | `getDefaultLanguageProfileNames()` Get default list of languages for detection.
    `ScoredString[]` | `recognizeLanguage(java.lang.String text)` Returns a scored list of possible languages for a text string.

    - ### Methods inherited from class edu.northwestern.at.morphadorner.corpuslinguistics.languagerecognizer.AbstractLanguageRecognizer

      `close, getLogger, setLogger`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### CybozuLabsLanguageRecognizer

          public CybozuLabsLanguageRecognizer()
                                       throws LangDetectException

      Create a language recognizer with the default language profiles.
      Throws:
        `LangDetectException`

    - #### CybozuLabsLanguageRecognizer

          public CybozuLabsLanguageRecognizer(java.util.List<java.lang.String> languages)
                                       throws LangDetectException

      Create a language recognizer with list of languages to recognize.
      Parameters:
        `languages` - List of names of languages to recognize.

        The list of languages references the profile names. These are usually two or three character ISO 696 language codes, e.g., "en" for English and "sco" for Scots dialect.

      Throws:
        `LangDetectException`

  - ### Method Detail

    - #### recognizeLanguage

          public ScoredString[] recognizeLanguage(java.lang.String text)

      Returns a scored list of possible languages for a text string.
      Specified by:
        `recognizeLanguage` in interface `LanguageRecognizer`
      Specified by:
        `recognizeLanguage` in class `AbstractLanguageRecognizer`
      Parameters:
        `text` - The text for which to determine the language.
      Returns:
        Array of ScoredList entries of language names and scores sorted in descending order by score. Null if language cannot be determined.

    - #### getAvailableLanguageProfileNames

          public java.util.List<java.lang.String> getAvailableLanguageProfileNames()

      Get list of available languages for detection.
      Returns:
        String list of available language profile names. These are the names set when this recognizer was created.

        The profile names are generally the two or three character ISO 639 two or three character language codes.

    - #### getDefaultLanguageProfileNames

          public static java.util.List<java.lang.String> getDefaultLanguageProfileNames()

      Get default list of languages for detection.
      Returns:
        String list of default language profile names.

        The profile names are generally the two or three character ISO 639 two or three character language codes. The current language recognizer may not use all of these profiles, or may add extra custom profiles.