Toggle navigation
Toggle navigation
此项目
正在载入...
Sign in
xuning
/
sherpaonnx
转到一个项目
Toggle navigation
项目
群组
代码片段
帮助
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
Fangjun Kuang
2025-05-09 10:48:30 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Committed by
GitHub
2025-05-09 10:48:30 +0800
Commit
a6834f6556a10756c6514bfcaf65715b9903a1f0
a6834f65
1 parent
562a5f7d
Show verbose logs in homophone replacer (#2194)
隐藏空白字符变更
内嵌
并排对比
正在显示
2 个修改的文件
包含
11 行增加
和
2 行删除
.github/workflows/build-wheels-macos-arm64.yaml
sherpa-onnx/csrc/homophone-replacer.cc
.github/workflows/build-wheels-macos-arm64.yaml
查看文件 @
a6834f6
...
...
@@ -90,7 +90,7 @@ jobs:
run
:
|
opts='--break-system-packages'
v=${{ matrix.python-version }}
if [[ $v == cp3
7 || $v == cp3
8 || $v == cp39 ]]; then
if [[ $v == cp38 || $v == cp39 ]]; then
opts=''
fi
...
...
sherpa-onnx/csrc/homophone-replacer.cc
查看文件 @
a6834f6
...
...
@@ -143,6 +143,12 @@ class HomophoneReplacer::Impl {
}
std
::
string
Apply
(
const
std
::
string
&
text
)
const
{
std
::
string
ans
;
if
(
text
.
empty
())
{
return
ans
;
}
bool
is_hmm
=
true
;
std
::
vector
<
std
::
string
>
words
;
...
...
@@ -170,13 +176,16 @@ class HomophoneReplacer::Impl {
pronunciations
.
push_back
(
std
::
move
(
p
));
}
std
::
string
ans
;
for
(
const
auto
&
r
:
replacer_list_
)
{
ans
=
r
->
Normalize
(
words
,
pronunciations
);
// TODO(fangjun): We support only 1 rule fst at present.
break
;
}
if
(
config_
.
debug
)
{
SHERPA_ONNX_LOGE
(
"Output text: '%s'"
,
ans
.
c_str
());
}
return
ans
;
}
...
...
请
注册
或
登录
后发表评论