alphacep / alphacep/vosk-api

JSON formatting broken in locale with comma separator

Đang mở
#808 8 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
Jupyter Notebook
Star
15.1k
Fork
1.8k
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

Hello,
first off, thank you for this piece of software. It runs very well and is easy to use.
It seems though that I ran into a bug (sorry if I'm wrong).
My locale is fr_FR and therefore floating numbers are formatted with a comma (ie 1,3 and not 1.3 as in English).
Now when I set vosk_recognizer_set_max_alternatives to more than one, vosk_recognizer_result and vosk_recognizer_final_result return a json string containing several alternatives with a confidence level for each one expressed as a floating number. It turns out that this number is formatted according to the locale (with a comma) which makes the string unreadable by common json parsers since we get things like :
"alternatives" : [{
"confidence" : 361,788818,
"text" : ""
}]

and commas are used by json to separate values. If I save the locale, change it to us_US, execute one of the above functions and change it back to what it was, it works (floating numbers are formatted with a dot).
I suspect we should get the same problem with vosk_recognizer_set_words (I didn't try though).
Thank you.

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.