Fix typos in the project - #3293
Conversation
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThis PR systematically corrects typos and spelling errors across the codebase, including docstrings, user-facing error messages, comments, and string literals. Changes span multiple language implementations (C, C++, Java, Kotlin, Lazarus, Python, JavaScript) and core library files with minimal functional impact beyond string corrections. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~15 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request focuses on enhancing the overall quality and professionalism of the project by meticulously correcting a wide array of typographical errors. The changes span across documentation, source code in multiple languages, build scripts, and web interfaces, ensuring consistency and improving clarity for both developers and users. This cleanup effort contributes to a more polished and reliable codebase. Highlights
Changelog
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request addresses numerous typos throughout the project, and the majority of the fixes are accurate. However, I've identified a couple of incorrect changes in scripts/supertonic/gen_calib_configs.py where French words were mistakenly 'corrected' to their English equivalents. Please see the detailed comments for specifics.
There was a problem hiding this comment.
Actionable comments posted: 4
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (2)
sherpa-onnx/csrc/utils.h (2)
35-53:⚠️ Potential issue | 🟡 MinorThis keyword doc still says “hotword.”
In the
EncodeKeywordscomment, Lines 37-38 still describe the input as “one hotword for each line.” That looks like a leftover typo and could confuse users reading the header docs.Suggested doc fix
- * `@param` is The input stream, it contains several lines, one hotword for each + * `@param` is The input stream, it contains several lines, one keyword for each🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@sherpa-onnx/csrc/utils.h` around lines 35 - 53, The comment for EncodeKeywords uses the outdated term "hotword" and should be changed to "keyword"; update the description lines that read "one hotword for each line" to "one keyword per line" (and scan the EncodeKeywords comment block in utils.h for any other "hotword" occurrences to replace), keeping the rest of the parameter explanations unchanged so the docs correctly refer to keywords instead of hotwords.
15-33:⚠️ Potential issue | 🟡 MinorThere’s still a doc typo in this comment block.
Line 24 still uses
@@param hotwords, which looks malformed and no longer matches the actual parameter namehotwords_id. Since this PR is already cleaning up typos, it’d be good to fix this block fully as well.Suggested doc fix
- * @@param hotwords The encoded ids to be written to. + * `@param` hotwords_id The encoded ids to be written to.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@sherpa-onnx/csrc/utils.h` around lines 15 - 33, The doc comment for EncodeHotwords has a malformed tag "@@param hotwords" and the name doesn't match the actual parameter; update the comment for the function EncodeHotwords to use "@param hotwords_id" (matching the parameter) and change the description to say "The encoded ids to be written to" or similar so the parameter name and description align with the signature (also verify boost_scores description if present).
🧹 Nitpick comments (2)
java-api-examples/src/websocketsrv/AsrWebsocketServer.java (2)
161-161: Additional typo: variable namedeocderTimeOut.The variable name has a typo ("deocder" instead of "decoder"). While renaming variables is a slightly larger change than fixing comment typos, this may be worth addressing for consistency if this PR aims to fix typos comprehensively.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@java-api-examples/src/websocketsrv/AsrWebsocketServer.java` at line 161, The variable name deocderTimeOut contains a typo; rename the identifier to decoderTimeOut throughout the file (and update any references) while keeping the config lookup key "deocder_time_out" unchanged unless you also intend to change external config; ensure the line using cfgMap.getOrDefault remains functionally identical (e.g., int decoderTimeOut = Integer.valueOf(cfgMap.getOrDefault("deocder_time_out", "30000"))); update any other usages of deocderTimeOut to decoderTimeOut.
37-37: Additional typo in this file: "deocdeing" → "decoding".Since this PR is focused on fixing typos, consider also fixing the typo in the comment on this line.
📝 Suggested fix
- // Queue waiting for deocdeing, use websocket as the key + // Queue waiting for decoding, use websocket as the key🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@java-api-examples/src/websocketsrv/AsrWebsocketServer.java` at line 37, In the AsrWebsocketServer class comment that reads "Queue waiting for deocdeing, use websocket as the key", correct the typo by changing "deocdeing" to "decoding" so the comment reads "Queue waiting for decoding, use websocket as the key"; locate this comment near the AsrWebsocketServer class declaration and update it accordingly.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@cmake/onnxruntime.cmake`:
- Line 73: The fatal error message uses the wrong CMake variable syntax so
CMAKE_SYSTEM_PROCESSOR won't be expanded; update the message call that contains
message(FATAL_ERROR "Unsupported processor {CMAKE_SYSTEM_PROCESSOR} for Darwin")
to use the correct CMake variable interpolation for CMAKE_SYSTEM_PROCESSOR
(i.e., replace the braces around CMAKE_SYSTEM_PROCESSOR with the ${...} form) so
the actual processor value is printed at runtime.
In `@scripts/supertonic/gen_calib_configs.py`:
- Around line 89-93: Restore the correct French spellings in the calibration
strings: change "Le traitement du language naturel aide les machines à
comprendre." back to "Le traitement du langage naturel aide les machines à
comprendre." and change "La normalisation du texte est importante pour la
pronunciation." back to "La normalisation du texte est importante pour la
prononciation." so the French prompts in the list used for calibration are
correct (modify the two string literals shown in the diff).
In `@sherpa-onnx/csrc/features.h`:
- Line 24: Update the comment in features.h to fix the typo by changing "actual"
to the adverb "actually" so the sentence reads "The actual feature dimension is
actually num_ceps"; locate the comment near the Features-related declarations
(in features.h) and replace the existing wording accordingly.
In `@sherpa-onnx/csrc/transpose-test.cc`:
- Line 14: Rename the misspelled test names from "Tranpose01" (and the other
occurrence "Tranpose02") to "Transpose01" and "Transpose02" respectively so the
TEST suite "Transpose" and test names are consistent; update the TEST macros
(e.g., TEST(Transpose, Tranpose01) -> TEST(Transpose, Transpose01)) and any
references to those test names in the file to match the corrected identifiers.
---
Outside diff comments:
In `@sherpa-onnx/csrc/utils.h`:
- Around line 35-53: The comment for EncodeKeywords uses the outdated term
"hotword" and should be changed to "keyword"; update the description lines that
read "one hotword for each line" to "one keyword per line" (and scan the
EncodeKeywords comment block in utils.h for any other "hotword" occurrences to
replace), keeping the rest of the parameter explanations unchanged so the docs
correctly refer to keywords instead of hotwords.
- Around line 15-33: The doc comment for EncodeHotwords has a malformed tag
"@@param hotwords" and the name doesn't match the actual parameter; update the
comment for the function EncodeHotwords to use "@param hotwords_id" (matching
the parameter) and change the description to say "The encoded ids to be written
to" or similar so the parameter name and description align with the signature
(also verify boost_scores description if present).
---
Nitpick comments:
In `@java-api-examples/src/websocketsrv/AsrWebsocketServer.java`:
- Line 161: The variable name deocderTimeOut contains a typo; rename the
identifier to decoderTimeOut throughout the file (and update any references)
while keeping the config lookup key "deocder_time_out" unchanged unless you also
intend to change external config; ensure the line using cfgMap.getOrDefault
remains functionally identical (e.g., int decoderTimeOut =
Integer.valueOf(cfgMap.getOrDefault("deocder_time_out", "30000"))); update any
other usages of deocderTimeOut to decoderTimeOut.
- Line 37: In the AsrWebsocketServer class comment that reads "Queue waiting for
deocdeing, use websocket as the key", correct the typo by changing "deocdeing"
to "decoding" so the comment reads "Queue waiting for decoding, use websocket as
the key"; locate this comment near the AsrWebsocketServer class declaration and
update it accordingly.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: ceddf593-8082-4a62-9250-6cbda4c57982
📒 Files selected for processing (39)
CHANGELOG.mdc-api-examples/keywords-spotter-buffered-tokens-keywords-c-api.cc-api-examples/speaker-identification-c-api.cc-api-examples/streaming-ctc-buffered-tokens-c-api.cc-api-examples/streaming-paraformer-buffered-tokens-c-api.cc-api-examples/streaming-zipformer-buffered-tokens-hotwords-c-api.ccmake/onnxruntime-linux-x86_64-gpu.cmakecmake/onnxruntime.cmakejava-api-examples/src/websocketsrv/AsrWebsocketServer.javakotlin-api-examples/test_online_asr.ktlazarus-examples/generate_subtitles/my_init.paslazarus-examples/generate_subtitles/unit1.paspython-api-examples/spoken-language-identification.pypython-api-examples/web/js/offline_record.jspython-api-examples/web/js/streaming_record.jsscripts/node-addon-api/lib/addon.jsscripts/paraformer/rknn/torch_model.pyscripts/sense-voice/rknn/torch_model.pyscripts/spleeter/convert_to_pb.pyscripts/supertonic/gen_calib_configs.pyscripts/text2token.pysherpa-onnx/csrc/ascend/offline-whisper-model-ascend.ccsherpa-onnx/csrc/features.hsherpa-onnx/csrc/hypothesis.hsherpa-onnx/csrc/offline-ctc-model.ccsherpa-onnx/csrc/offline-websocket-server-impl.ccsherpa-onnx/csrc/online-conformer-transducer-model.hsherpa-onnx/csrc/online-recognizer-impl.ccsherpa-onnx/csrc/session.ccsherpa-onnx/csrc/transpose-test.ccsherpa-onnx/csrc/utils.hsherpa-onnx/pascal-api/portaudio.passherpa-onnx/python/sherpa_onnx/cli.pysherpa-onnx/python/sherpa_onnx/online_recognizer.pysherpa-onnx/python/sherpa_onnx/utils.pywasm/asr/app-asr.jswasm/kws/app.jswasm/vad-asr/app-vad-asr.jswasm/vad/app-vad.js
| // | ||
| // Note: for mfcc, this value is also for num_mel_bins. | ||
| // The actual feature dimension is actuall num_ceps | ||
| // The actual feature dimension is actual num_ceps |
There was a problem hiding this comment.
Incomplete typo fix: "actual" should be "actually".
The typo fix changed "actuall" to "actual", but the grammatically correct word here is "actually" (adverb). The sentence should read: "The actual feature dimension is actually num_ceps".
📝 Proposed fix
- // The actual feature dimension is actual num_ceps
+ // The actual feature dimension is actually num_ceps📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| // The actual feature dimension is actual num_ceps | |
| // The actual feature dimension is actually num_ceps |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@sherpa-onnx/csrc/features.h` at line 24, Update the comment in features.h to
fix the typo by changing "actual" to the adverb "actually" so the sentence reads
"The actual feature dimension is actually num_ceps"; locate the comment near the
Features-related declarations (in features.h) and replace the existing wording
accordingly.
| namespace sherpa_onnx { | ||
|
|
||
| TEST(Tranpose, Tranpose01) { | ||
| TEST(Transpose, Tranpose01) { |
There was a problem hiding this comment.
Rename the test cases to remove the remaining typo.
The suite name is fixed, but the test names still use Tranpose..., so this file remains inconsistent with the typo-cleanup goal and makes test output/searches a bit harder.
✏️ Proposed fix
-TEST(Transpose, Tranpose01) {
+TEST(Transpose, Transpose01) {
...
-TEST(Transpose, Tranpose12) {
+TEST(Transpose, Transpose12) {Also applies to: 38-38
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@sherpa-onnx/csrc/transpose-test.cc` at line 14, Rename the misspelled test
names from "Tranpose01" (and the other occurrence "Tranpose02") to "Transpose01"
and "Transpose02" respectively so the TEST suite "Transpose" and test names are
consistent; update the TEST macros (e.g., TEST(Transpose, Tranpose01) ->
TEST(Transpose, Transpose01)) and any references to those test names in the file
to match the corrected identifiers.
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Fixes a set of typos across multiple language bindings, examples, build scripts, and documentation/comments to improve clarity and professionalism of user-facing messages and internal docs.
Changes:
- Corrected spelling in user-visible status/error strings across WASM/JS examples and add-on loader messaging.
- Fixed typos in Python/C/C++/Pascal/Kotlin/Java examples and inline documentation/comments.
- Cleaned up changelog and CMake messaging typos.
Reviewed changes
Copilot reviewed 38 out of 38 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| wasm/vad/app-vad.js | Fix typo in getUserMedia error log text |
| wasm/vad-asr/app-vad-asr.js | Fix recognizer/status typos and getUserMedia error log text |
| wasm/kws/app.js | Fix typo in getUserMedia error log text |
| wasm/asr/app-asr.js | Fix recognizer/status typos and getUserMedia error log text |
| sherpa-onnx/python/sherpa_onnx/utils.py | Fix typos in CJK/non-CJK comment text |
| sherpa-onnx/python/sherpa_onnx/online_recognizer.py | Fix typo in docstring (“estimation”) |
| sherpa-onnx/python/sherpa_onnx/cli.py | Fix typos in CLI docstring (“starting”) |
| sherpa-onnx/pascal-api/portaudio.pas | Fix multiple typos in PortAudio Pascal header comments |
| sherpa-onnx/csrc/utils.h | Fix typo in comments (“false”) |
| sherpa-onnx/csrc/transpose-test.cc | Renamed test suite name to correct spelling (“Transpose”) |
| sherpa-onnx/csrc/session.cc | Fix typo in log message (“only”) |
| sherpa-onnx/csrc/online-recognizer-impl.cc | Fix typo in comment (“supported”) |
| sherpa-onnx/csrc/online-conformer-transducer-model.h | Fix typo in comment (“metadata”) |
| sherpa-onnx/csrc/offline-websocket-server-impl.cc | Fix typo in error log (“recognizer”) |
| sherpa-onnx/csrc/offline-ctc-model.cc | Fix typo in log message (“metadata”) |
| sherpa-onnx/csrc/hypothesis.h | Fix typos in comments (“modified”) |
| sherpa-onnx/csrc/features.h | Adjusted comment wording for feature dimension |
| sherpa-onnx/csrc/ascend/offline-whisper-model-ascend.cc | Fix typo in comment (“initialize”) |
| scripts/text2token.py | Fix typos in argparse help text (“starting”) |
| scripts/supertonic/gen_calib_configs.py | Modified French calibration phrases |
| scripts/spleeter/convert_to_pb.py | Fix typo in comment (“useful”) |
| scripts/sense-voice/rknn/torch_model.py | Fix typo in docstring (“dimension”) |
| scripts/paraformer/rknn/torch_model.py | Fix typos in docstrings (“dimension”) |
| scripts/node-addon-api/lib/addon.js | Fix typo in user-facing guidance message (“remember”) |
| python-api-examples/web/js/streaming_record.js | Fix typo in getUserMedia error log text |
| python-api-examples/web/js/offline_record.js | Fix typo in getUserMedia error log text |
| python-api-examples/spoken-language-identification.py | Fix typo in module docstring (“language”) |
| lazarus-examples/generate_subtitles/unit1.pas | Fix typo in status matching text (“successfully”) |
| lazarus-examples/generate_subtitles/my_init.pas | Fix typos in guidance/status strings (“download”, “successfully”) |
| kotlin-api-examples/test_online_asr.kt | Fix typo in comment (“download”) |
| java-api-examples/src/websocketsrv/AsrWebsocketServer.java | Fix typo in comment (“recognizer”) |
| cmake/onnxruntime.cmake | Fix typo in fatal error message (“Unsupported”) |
| cmake/onnxruntime-linux-x86_64-gpu.cmake | Fix typo in comment (“Requires”) |
| c-api-examples/streaming-zipformer-buffered-tokens-hotwords-c-api.c | Fix typo in file read error message (“occurred”) |
| c-api-examples/streaming-paraformer-buffered-tokens-c-api.c | Fix typo in file read error message (“occurred”) |
| c-api-examples/streaming-ctc-buffered-tokens-c-api.c | Fix typo in file read error message (“occurred”) |
| c-api-examples/keywords-spotter-buffered-tokens-keywords-c-api.c | Fix typo in file read error message (“occurred”) |
| c-api-examples/speaker-identification-c-api.c | Fix typo in comment (“Remember”) |
| CHANGELOG.md | Fix multiple typos in changelog entries |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
This introduces a French spelling error: in French it should be “langage” (not “language”). Please revert to the correct French word to keep the calibration text natural/grammatical.
| "Le traitement du langage naturel aide les machines à comprendre.", |
There was a problem hiding this comment.
This introduces an English word into a French sentence. It should be “prononciation” in French; otherwise the calibration phrase looks incorrect.
| "La normalisation du texte est importante pour la prononciation.", |
| // | ||
| // Note: for mfcc, this value is also for num_mel_bins. | ||
| // The actual feature dimension is actuall num_ceps | ||
| // The actual feature dimension is actual num_ceps |
There was a problem hiding this comment.
The updated comment reads ungrammatically (“actual … is actual …”). Consider changing the second “actual” to “actually”, or rephrasing to “The actual feature dimension is num_ceps” to avoid confusion.
| // The actual feature dimension is actual num_ceps | |
| // The actual feature dimension is num_ceps. |
| endif() | ||
| else() | ||
| message(FATAL_ERROR "Unsupport processor {CMAKE_SYSTEM_PROCESSOR} for Darwin") | ||
| message(FATAL_ERROR "Unsupported processor {CMAKE_SYSTEM_PROCESSOR} for Darwin") |
There was a problem hiding this comment.
CMake won’t substitute {CMAKE_SYSTEM_PROCESSOR} in a string; this will print literally. Use ${CMAKE_SYSTEM_PROCESSOR} so users can see the actual detected processor in the fatal error message.
| message(FATAL_ERROR "Unsupported processor {CMAKE_SYSTEM_PROCESSOR} for Darwin") | |
| message(FATAL_ERROR "Unsupported processor ${CMAKE_SYSTEM_PROCESSOR} for Darwin") |
| namespace sherpa_onnx { | ||
|
|
||
| TEST(Tranpose, Tranpose01) { | ||
| TEST(Transpose, Tranpose01) { |
There was a problem hiding this comment.
The test suite name is corrected to Transpose, but the test case names still use the misspelling TranposeXX. Renaming them to Transpose01 / Transpose12 would make test output and filtering consistent and easier to search.
| } | ||
|
|
||
| TEST(Tranpose, Tranpose12) { | ||
| TEST(Transpose, Tranpose12) { |
There was a problem hiding this comment.
The test suite name is corrected to Transpose, but the test case names still use the misspelling TranposeXX. Renaming them to Transpose01 / Transpose12 would make test output and filtering consistent and easier to search.
Summary by CodeRabbit
Bug Fixes
Documentation
Tests