From c347f64b70c05ae068ee544eab599b349a91ec6b Mon Sep 17 00:00:00 2001 From: pengzhendong <275331498@qq.com> Date: Wed, 10 Jun 2026 10:34:32 +0800 Subject: [PATCH 1/4] fix: use StringTokenType for OpenFst 1.8+ compatibility (#359) --- runtime/processor/wetext_processor.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/runtime/processor/wetext_processor.cc b/runtime/processor/wetext_processor.cc index a6f6168a..99f2193d 100644 --- a/runtime/processor/wetext_processor.cc +++ b/runtime/processor/wetext_processor.cc @@ -14,15 +14,15 @@ #include "processor/wetext_processor.h" -using fst::TokenType; +using fst::StringTokenType; namespace wetext { Processor::Processor(const std::string& tagger_path, const std::string& verbalizer_path) { tagger_.reset(StdVectorFst::Read(tagger_path)); verbalizer_.reset(StdVectorFst::Read(verbalizer_path)); - compiler_ = std::make_shared>(TokenType::BYTE); - printer_ = std::make_shared>(TokenType::BYTE); + compiler_ = std::make_shared>(StringTokenType::BYTE); + printer_ = std::make_shared>(StringTokenType::BYTE); if (tagger_path.find("zh_tn_") != tagger_path.npos) { parse_type_ = ParseType::kZH_TN; From e42e2242b768ad6165d640ab1f508f5cd6597a8f Mon Sep 17 00:00:00 2001 From: pengzhendong <275331498@qq.com> Date: Wed, 10 Jun 2026 10:38:45 +0800 Subject: [PATCH 2/4] ci: add C++ runtime build workflow Trigger on runtime/** changes. Builds on ubuntu and macos. --- .github/workflows/runtime.yml | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 .github/workflows/runtime.yml diff --git a/.github/workflows/runtime.yml b/.github/workflows/runtime.yml new file mode 100644 index 00000000..c8582b4c --- /dev/null +++ b/.github/workflows/runtime.yml @@ -0,0 +1,22 @@ +name: Runtime Build + +on: + workflow_dispatch: + pull_request: + paths: + - 'runtime/**' + - '.github/workflows/runtime.yml' + +jobs: + build: + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, macos-latest] + steps: + - uses: actions/checkout@v4 + - name: Build runtime + run: | + cmake -B build -S runtime -DBUILD_TESTING=OFF + cmake --build build -j$(nproc 2>/dev/null || sysctl -n hw.ncpu) From 1abc4bd0522c8bb587a7ea13387729ab5260027f Mon Sep 17 00:00:00 2001 From: pengzhendong <275331498@qq.com> Date: Wed, 10 Jun 2026 10:42:38 +0800 Subject: [PATCH 3/4] fix: revert to TokenType for csukuangfj/openfst fork compatibility The project uses csukuangfj/openfst v1.8.5 which keeps the original fst::TokenType enum. The previous commit incorrectly renamed it to StringTokenType (which is used in official OpenFst releases). --- runtime/processor/wetext_processor.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/runtime/processor/wetext_processor.cc b/runtime/processor/wetext_processor.cc index 99f2193d..a6f6168a 100644 --- a/runtime/processor/wetext_processor.cc +++ b/runtime/processor/wetext_processor.cc @@ -14,15 +14,15 @@ #include "processor/wetext_processor.h" -using fst::StringTokenType; +using fst::TokenType; namespace wetext { Processor::Processor(const std::string& tagger_path, const std::string& verbalizer_path) { tagger_.reset(StdVectorFst::Read(tagger_path)); verbalizer_.reset(StdVectorFst::Read(verbalizer_path)); - compiler_ = std::make_shared>(StringTokenType::BYTE); - printer_ = std::make_shared>(StringTokenType::BYTE); + compiler_ = std::make_shared>(TokenType::BYTE); + printer_ = std::make_shared>(TokenType::BYTE); if (tagger_path.find("zh_tn_") != tagger_path.npos) { parse_type_ = ParseType::kZH_TN; From f4cb30df11a85d1a7d173cadf5126f3bbf1773d1 Mon Sep 17 00:00:00 2001 From: pengzhendong <275331498@qq.com> Date: Wed, 10 Jun 2026 10:44:01 +0800 Subject: [PATCH 4/4] fix: drop explicit TokenType::BYTE for OpenFst compatibility (#359) Both StringCompiler and StringPrinter default to BYTE mode, so the argument can be omitted entirely. This avoids the TokenType vs StringTokenType naming difference between the csukuangfj fork and official OpenFst releases. --- runtime/processor/wetext_processor.cc | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/runtime/processor/wetext_processor.cc b/runtime/processor/wetext_processor.cc index a6f6168a..dd342b4f 100644 --- a/runtime/processor/wetext_processor.cc +++ b/runtime/processor/wetext_processor.cc @@ -14,15 +14,13 @@ #include "processor/wetext_processor.h" -using fst::TokenType; - namespace wetext { Processor::Processor(const std::string& tagger_path, const std::string& verbalizer_path) { tagger_.reset(StdVectorFst::Read(tagger_path)); verbalizer_.reset(StdVectorFst::Read(verbalizer_path)); - compiler_ = std::make_shared>(TokenType::BYTE); - printer_ = std::make_shared>(TokenType::BYTE); + compiler_ = std::make_shared>(); + printer_ = std::make_shared>(); if (tagger_path.find("zh_tn_") != tagger_path.npos) { parse_type_ = ParseType::kZH_TN;