Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

12
LINES

< > BotCompany Repo | #1026987 // vosk_postprocess

JavaX fragment (include) [tags: use-pretranspiled]

Transpiled version (2716L) is out of date.

sS vosk_postprocess(S voskOutput, O... _) {
  optPar bool verbose;
  new LS out;
  for (S s : tlft(voskOutput)) pcall {
    if (startsWith(s, "{")) {
      if (verbose) print("JSON line? " + s);
      S text = cast jsonDecodeMap(s).get('text);
      if (nempty(text)) out.add(text);
    }
  }
  ret lines_rtrim(out);
}

download  show line numbers  debug dex  old transpilations   

Travelled to 7 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt, xrpafgyirdlv

No comments. add comment

Snippet ID: #1026987
Snippet name: vosk_postprocess
Eternal ID of this version: #1026987/4
Text MD5: dd87dc7380670ec445d14536ab9f23ff
Author: stefan
Category: javax / speech recognition
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2020-02-07 00:15:22
Source code size: 331 bytes / 12 lines
Pitched / IR pitched: No / No
Views / Downloads: 154 / 225
Version history: 3 change(s)
Referenced in: [show references]