| class info |
| com.huawei.hms.mlsdk.langdetect.local.MLLocalLangDetector |
| Local offline language detector. |
| Type | Name | Desc |
| float | FIRST_BEST_DETECTION_LANGUAGE_TRUSTED_THRESHOLD | Confidence threshold in the scenario where the language detection result with the highest confidence is returned. |
| float | PROBABILITY_DETECTION_LANGUAGE_TRUSTED_THRESHOLD | Confidence threshold in the scenario where detection results of multiple languages are returned. |
| String | UNDETECTION_LANGUAGE_TRUSTED_THRESHOLD | Undetected language code. |
| Return type | Method name |
| MLLocalLangDetector | create(MLApplication app, MLLocalLangDetectorSetting setting) |
| com.huawei.hmf.tasks.Task | firstBestDetect(String text) |
| com.huawei.hmf.tasks.Task<list | probabilityDetect(String text) |
| void | stop() |
| Constant |
| public static final String UNDETECTION_LANGUAGE_TRUSTED_THRESHOLD |
Undetected language code. Constant Value:”unknown” |
| Method |
| public static synchronized MLLocalLangDetector create(MLApplication app, MLLocalLangDetectorSetting setting) |
| Creates a local offline language detector object. |
Parameters
| Parameter name | Parameter desc |
| app | Specified app. |
| setting | Local offline language detector configurator instance. |
Return
| Type | desc |
| MLLocalLangDetector | Local offline language detector object. |
| Method |
| public com.huawei.hmf.tasks.Task<String> firstBestDetect(String text) |
| Returns the language detection result with the highest confidence based on the supplied text. |
Parameters
| Parameter name | Parameter desc |
| text | Text. |
Return
| Type | desc |
| com.huawei.hmf.tasks.Task<String> | Task object containing the language detection results. |
| Method |
public com.huawei.hmf.tasks.Task<List<com.huawei.hms.mlsdk.langdetect.MLDetectedLang>> probabilityDetect(String text) |
| Returns multi-language detection results based on the supplied text. |
Parameters
| Parameter name | Parameter desc |
| text | Text. |
Return
| Type | desc |
| com.huawei.hmf.tasks.Task<List<com.huawei.hms.mlsdk.langdetect.MLDetectedLang>> | Task object containing the multi-language detection results. |
| Method |
| public void stop() |
| Releases resources, including input and output streams. |