riderodd / react-native-vosk

Speech recognition module for react native using Vosk library
MIT License
41 stars 10 forks source link

Vosk OnPartial returning Null #48

Closed ShristiC closed 6 months ago

ShristiC commented 6 months ago

Issue: https://github.com/riderodd/react-native-vosk/issues/47

Problem Summary

iOS OnPartial returns a null string to the handler. On investigation, there is a bug with how the parsedResult.partial, which is an Optional String, is handled. The React Native Vosk Swift library sends, parsedResult.partial!.data instead of parsedResult.partial as the value for the callback event. data does not exist in the partial text, and a check for the partial string being non-null and different from the last partial string is made before, guaranteeing the partial variable to have a non-null value.