predict

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

Complete the given phrase, where phrase is the incomplete word. For instance, if the given input is hel, the predictions would be hell , hello , help , helped , helps .

Parameters

phrase

The input word, which has to be completed

onResult

The callback which delivers the possible completions for the given phrase as a List<String>.

onError

The callback which delivers a TextPredictorError if the operation fails