Class DetectionApiImpl

    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String ATTR_FORMAT  
      static java.lang.String ATTR_TEXT  
      static java.lang.String METHOD_DETECT  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.Optional<Language> detect​(java.lang.String text)
      Detects the language of the specified text.
      java.util.Optional<Language> detect​(java.lang.String text, TextFormat format)
      Detects the language of the specified text.
      • Methods inherited from class java.lang.Object

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

      • DetectionApiImpl

        public DetectionApiImpl​(ApiContext context)
    • Method Detail

      • detect

        @Nonnull
        public java.util.Optional<Language> detect​(@Nullable
                                                   java.lang.String text)
        Detects the language of the specified text. Text format is TextFormat.PLAIN_TEXT.
        Specified by:
        detect in interface DetectionApi
        Parameters:
        text - the text to detect the language for
        Returns:
        detected language
      • detect

        @Nonnull
        public java.util.Optional<Language> detect​(@Nullable
                                                   java.lang.String text,
                                                   @Nullable
                                                   TextFormat format)
        Detects the language of the specified text.
        Specified by:
        detect in interface DetectionApi
        Parameters:
        text - the text to detect the language for
        format - text format: html or plain text
        Returns:
        detected language