Class TextLangDetector

java.lang.Object
org.apache.tika.language.detect.LanguageDetector
org.apache.tika.langdetect.mitll.TextLangDetector

public class TextLangDetector extends org.apache.tika.language.detect.LanguageDetector
Language Detection using MIT Lincoln Lab’s Text.jl library https://github.com/trevorlewis/TextREST.jl

Please run the TextREST.jl server before using this.

  • Field Summary

    Fields inherited from class org.apache.tika.language.detect.LanguageDetector

    mixedLanguages, shortText
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    addText(char[] cbuf, int off, int len)
     
    protected static boolean
     
    List<org.apache.tika.language.detect.LanguageResult>
     
    boolean
    hasModel(String language)
     
    org.apache.tika.language.detect.LanguageDetector
     
    org.apache.tika.language.detect.LanguageDetector
     
    void
     
    org.apache.tika.language.detect.LanguageDetector
    setPriors(Map<String,Float> languageProbabilities)
     

    Methods inherited from class org.apache.tika.language.detect.LanguageDetector

    addText, detect, detect, detectAll, getDefaultLanguageDetector, getLanguageDetectors, getLanguageDetectors, hasEnoughText, isMixedLanguages, isShortText, setMixedLanguages, setShortText

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • TextLangDetector

      public TextLangDetector()
  • Method Details

    • canRun

      protected static boolean canRun()
    • loadModels

      public org.apache.tika.language.detect.LanguageDetector loadModels() throws IOException
      Specified by:
      loadModels in class org.apache.tika.language.detect.LanguageDetector
      Throws:
      IOException
    • loadModels

      public org.apache.tika.language.detect.LanguageDetector loadModels(Set<String> set) throws IOException
      Specified by:
      loadModels in class org.apache.tika.language.detect.LanguageDetector
      Throws:
      IOException
    • hasModel

      public boolean hasModel(String language)
      Specified by:
      hasModel in class org.apache.tika.language.detect.LanguageDetector
    • setPriors

      public org.apache.tika.language.detect.LanguageDetector setPriors(Map<String,Float> languageProbabilities) throws IOException
      Specified by:
      setPriors in class org.apache.tika.language.detect.LanguageDetector
      Throws:
      IOException
    • reset

      public void reset()
      Specified by:
      reset in class org.apache.tika.language.detect.LanguageDetector
    • addText

      public void addText(char[] cbuf, int off, int len)
      Specified by:
      addText in class org.apache.tika.language.detect.LanguageDetector
    • detectAll

      public List<org.apache.tika.language.detect.LanguageResult> detectAll()
      Specified by:
      detectAll in class org.apache.tika.language.detect.LanguageDetector