From 719ba9f21f9874c2ad58e4153b60d36e54f014a1 Mon Sep 17 00:00:00 2001 From: dujing Date: Fri, 8 Sep 2023 16:01:10 +0800 Subject: [PATCH] fix clang-format --- runtime/core/api/wenet_api.cc | 12 ++++++------ runtime/core/post_processor/post_processor.cc | 8 ++++---- runtime/core/post_processor/post_processor.h | 2 +- runtime/core/post_processor/processor.h | 2 +- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/runtime/core/api/wenet_api.cc b/runtime/core/api/wenet_api.cc index db7eb09fc..11cf2fcc8 100644 --- a/runtime/core/api/wenet_api.cc +++ b/runtime/core/api/wenet_api.cc @@ -91,18 +91,18 @@ class Recognizer { post_process_opts_->language_type = wenet::kIndoEuropean; } resource_->post_processor = - std::make_shared(*post_process_opts_); + std::make_shared(*post_process_opts_); // Optional: ITN std::string itn_tagger_path = - wenet::JoinPath(model_dir, "zh_itn_tagger.fst"); + wenet::JoinPath(model_dir, "zh_itn_tagger.fst"); std::string itn_verbalizer_path = - wenet::JoinPath(model_dir, "zh_itn_verbalizer.fst"); - if (wenet::FileExists(itn_tagger_path) - && wenet::FileExists(itn_verbalizer_path)) { + wenet::JoinPath(model_dir, "zh_itn_verbalizer.fst"); + if (wenet::FileExists(itn_tagger_path) && + wenet::FileExists(itn_verbalizer_path)) { LOG(INFO) << "Reading ITN fst"; post_process_opts_->itn = true; auto postprocessor = - std::make_shared(*post_process_opts_); + std::make_shared(*post_process_opts_); postprocessor->InitITNResource(itn_tagger_path, itn_verbalizer_path); resource_->post_processor = postprocessor; } diff --git a/runtime/core/post_processor/post_processor.cc b/runtime/core/post_processor/post_processor.cc index 514f27815..9af50095c 100644 --- a/runtime/core/post_processor/post_processor.cc +++ b/runtime/core/post_processor/post_processor.cc @@ -20,11 +20,11 @@ #include "utils/string.h" namespace wenet { -void PostProcessor::InitITNResource( - const std::string& tagger_path, const std::string& verbalizer_path) { - auto itn_processor = +void PostProcessor::InitITNResource(const std::string& tagger_path, + const std::string& verbalizer_path) { + auto itn_processor = std::make_shared(tagger_path, verbalizer_path); - itn_resource = itn_processor; + itn_resource = itn_processor; } std::string PostProcessor::ProcessSpace(const std::string& str) { diff --git a/runtime/core/post_processor/post_processor.h b/runtime/core/post_processor/post_processor.h index b6ca61204..f118b44d3 100644 --- a/runtime/core/post_processor/post_processor.h +++ b/runtime/core/post_processor/post_processor.h @@ -64,7 +64,7 @@ class PostProcessor { // void Punctuate(const std::string& str); void InitITNResource(const std::string& tagger_path, - const std::string& verbalizer_path); + const std::string& verbalizer_path); private: std::shared_ptr itn_resource = nullptr; diff --git a/runtime/core/post_processor/processor.h b/runtime/core/post_processor/processor.h index 08d3b1e07..56637942f 100644 --- a/runtime/core/post_processor/processor.h +++ b/runtime/core/post_processor/processor.h @@ -16,8 +16,8 @@ #ifndef POST_PROCESSOR_PROCESSOR_H_ #define POST_PROCESSOR_PROCESSOR_H_ -#include #include +#include #include "fst/fstlib.h" #include "post_processor/token_parser.h"