go: Add SetNlsml to VoskRecognizer - #2064
Open
fra-shipper wants to merge 1 commit into
Open
Conversation
vosk_recognizer_set_nlsml toggles NLSML output (the W3C markup used by VoiceXML/IVR platforms) but was only wrapped for VoskBatchRecognizer (go/batch.go). The standard VoskRecognizer in go/vosk.go had no binding for it, unlike the Python and Ruby bindings which both expose it on their standard recognizer. Add SetNlsml on VoskRecognizer mirroring the existing SetWords / SetPartialWords wrappers and the SetNlsml already present on VoskBatchRecognizer.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The C API exposes
vosk_recognizer_set_nlsml()(declared insrc/vosk_api.h, implemented insrc/recognizer.cc) and the Python, Java, C#, and Node bindings all wrap it, but the Go binding does not. Go users cannot switch a recognizer to NLSML output without dropping to cgo themselves.This adds
(*VoskRecognizer).SetNlsml, following the exact shape of the neighbouringSetPartialWords/SetWordswrappers in the same file.Testing:
go build .on thego/package is clean andgofmt -l vosk.goreports nothing introduced by this diff. The example binaries undergo/examplecannot be linked here because that requires the prebuiltlibvoskshared library, which is distributed as a binary release rather than built from this tree, so no runtime test was run against a real model.