predict

fun predict(word: String, onResult: (List<String>) -> Unit, onError: (TextPredictorError) -> Unit)

Predicts the next words, given the current word. If word="how", then this method will return [ are , you , should ] as a List<String> in the onResult callback.

Parameters

word

The current word entered by the user, using which following words will be suggested.

onResult

The callback which delivers a List<String> containing the predicted words.

onError

Provides a TextPredictorError when the operation fails