Class LanguageBackends
java.lang.Object
com.codename1.ai.language.LanguageBackends
Selects native backends for language identification, translation, and Smart Reply. Automatic selection uses ML Kit on Android, Apple Natural Language for iOS identification. iOS translation and Smart Reply require their feature-specific ML Kit selector methods.
The feature-specific methods are also build-time dependency markers. They intentionally remain distinct even though they return the same runtime backend id, because the builder scans each call site to include only the requested ML Kit component.
-
Method Summary
Modifier and TypeMethodDescriptionstatic LanguageBackendSelects Apple's dependency-free Natural Language framework for language identification.static LanguageBackendauto()static LanguageBackendSelects ML Kit specifically for language identification.static LanguageBackendSelects ML Kit Smart Reply.static LanguageBackendSelects ML Kit translation.
-
Method Details
-
auto
- Returns:
- the platform-recommended dependency-minimal backend
-
appleNaturalLanguage
Selects Apple's dependency-free Natural Language framework for language identification. This backend is available on iOS 12 and newer and is not available on Android.- Returns:
- the Apple Natural Language backend selector
-
mlKitLanguageIdentification
Selects ML Kit specifically for language identification. Calling this method lets the builder add the Language ID pod only when the application opts out of the Apple-native iOS default.- Returns:
- the ML Kit language-identification selector
-
mlKitTranslation
Selects ML Kit translation. Calling this method is the build-time marker that adds the translation pod on iOS; merely referencingTranslatordoes not add it or disable the arm64 simulator.- Returns:
- the ML Kit translation selector
-
mlKitSmartReply
Selects ML Kit Smart Reply. Calling this method is the build-time marker that adds the Smart Reply pod on iOS; merely referencingSmartReplydoes not add it or disable the arm64 simulator.- Returns:
- the ML Kit Smart Reply selector
-