Add C# API for homophone replacer (#2165)

This commit is contained in:
Fangjun Kuang
2025-04-29 21:36:38 +08:00
committed by GitHub
parent 63d01a9534
commit 50b5329572
3 changed files with 32 additions and 0 deletions

View File

@@ -0,0 +1,26 @@
/// 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;
}
}