Skip to content

Commit

Permalink
fix clang-format
Browse files Browse the repository at this point in the history
  • Loading branch information
duj12 committed Sep 8, 2023
1 parent c7fa8d4 commit 719ba9f
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
12 changes: 6 additions & 6 deletions runtime/core/api/wenet_api.cc
Original file line number Diff line number Diff line change
Expand Up @@ -91,18 +91,18 @@ class Recognizer {
post_process_opts_->language_type = wenet::kIndoEuropean;
}
resource_->post_processor =
std::make_shared<wenet::PostProcessor>(*post_process_opts_);
std::make_shared<wenet::PostProcessor>(*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<wenet::PostProcessor>(*post_process_opts_);
std::make_shared<wenet::PostProcessor>(*post_process_opts_);
postprocessor->InitITNResource(itn_tagger_path, itn_verbalizer_path);
resource_->post_processor = postprocessor;
}
Expand Down
8 changes: 4 additions & 4 deletions runtime/core/post_processor/post_processor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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<wenet::Processor>(tagger_path, verbalizer_path);
itn_resource = itn_processor;
itn_resource = itn_processor;
}

std::string PostProcessor::ProcessSpace(const std::string& str) {
Expand Down
2 changes: 1 addition & 1 deletion runtime/core/post_processor/post_processor.h
Original file line number Diff line number Diff line change
Expand Up @@ -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<wenet::Processor> itn_resource = nullptr;
Expand Down
2 changes: 1 addition & 1 deletion runtime/core/post_processor/processor.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
#ifndef POST_PROCESSOR_PROCESSOR_H_
#define POST_PROCESSOR_PROCESSOR_H_

#include <string>
#include <memory>
#include <string>
#include "fst/fstlib.h"
#include "post_processor/token_parser.h"

Expand Down

0 comments on commit 719ba9f

Please sign in to comment.