Interface DetectionApi
-
- All Known Implementing Classes:
DetectionApiImpl
public interface DetectionApi
Service allows to detects language of specified text.
Official REST API documentation
-
-
Method Summary
All Methods Instance Methods Abstract 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.
-
-
-
Method Detail
-
detect
@Nonnull java.util.Optional<Language> detect(@Nullable java.lang.String text)
Detects the language of the specified text. Text format isTextFormat.PLAIN_TEXT
.- Parameters:
text
- the text to detect the language for- Returns:
- detected language
-
detect
@Nonnull java.util.Optional<Language> detect(@Nullable java.lang.String text, @Nullable TextFormat format)
Detects the language of the specified text.- Parameters:
text
- the text to detect the language forformat
- text format: html or plain text- Returns:
- detected language
-
-