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-04-29 21:36:38 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Committed by
GitHub
2025-04-29 21:36:38 +0800
Commit
50b53295729209587db2e256f975737bc8cdbf94
50b53295
1 parent
63d01a95
Add C# API for homophone replacer (#2165)
隐藏空白字符变更
内嵌
并排对比
正在显示
3 个修改的文件
包含
32 行增加
和
0 行删除
scripts/dotnet/HomophoneReplacerConfig.cs
scripts/dotnet/OfflineRecognizerConfig.cs
scripts/dotnet/OnlineRecognizerConfig.cs
scripts/dotnet/HomophoneReplacerConfig.cs
0 → 100644
查看文件 @
50b5329
/// Copyright (c) 2025 Xiaomi Corporation (authors: Fangjun Kuang)
using
System.Runtime.InteropServices
;
namespace
SherpaOnnx
{
[
StructLayout
(
LayoutKind
.
Sequential
)]
public
struct
HomophoneReplacerConfig
{
public
HomophoneReplacerConfig
()
{
DictDir
=
""
;
Lexicon
=
""
;
RuleFsts
=
""
;
}
[
MarshalAs
(
UnmanagedType
.
LPStr
)]
public
string
DictDir
;
[
MarshalAs
(
UnmanagedType
.
LPStr
)]
public
string
Lexicon
;
[
MarshalAs
(
UnmanagedType
.
LPStr
)]
public
string
RuleFsts
;
}
}
...
...
scripts/dotnet/OfflineRecognizerConfig.cs
查看文件 @
50b5329
...
...
@@ -20,6 +20,7 @@ namespace SherpaOnnx
RuleFsts
=
""
;
RuleFars
=
""
;
BlankPenalty
=
0.0F
;
Hr
=
new
HomophoneReplacerConfig
();
}
public
FeatureConfig
FeatConfig
;
public
OfflineModelConfig
ModelConfig
;
...
...
@@ -42,5 +43,7 @@ namespace SherpaOnnx
public
string
RuleFars
;
public
float
BlankPenalty
;
public
HomophoneReplacerConfig
Hr
;
}
}
...
...
scripts/dotnet/OnlineRecognizerConfig.cs
查看文件 @
50b5329
...
...
@@ -28,6 +28,7 @@ namespace SherpaOnnx
BlankPenalty
=
0.0F
;
HotwordsBuf
=
""
;
HotwordsBufSize
=
0
;
Hr
=
new
HomophoneReplacerConfig
();
}
public
FeatureConfig
FeatConfig
;
public
OnlineModelConfig
ModelConfig
;
...
...
@@ -79,5 +80,7 @@ namespace SherpaOnnx
public
string
HotwordsBuf
;
public
int
HotwordsBufSize
;
public
HomophoneReplacerConfig
Hr
;
}
}
...
...
请
注册
或
登录
后发表评论