Browse Source

2024.5.10-去除ITN的依赖构建

master
Administrator 1 year ago
parent
commit
21e917630e
2 changed files with 6 additions and 6 deletions
  1. +5
    -5
      post_processor/post_processor.cc
  2. +1
    -1
      post_processor/post_processor.h

+ 5
- 5
post_processor/post_processor.cc

@ -78,11 +78,11 @@ std::string PostProcessor::Process(const std::string& str, bool finish) {
result = ProcessSymbols(str); result = ProcessSymbols(str);
result = ProcessSpace(result); result = ProcessSpace(result);
// TODO(xcsong): do punctuation if finish == true // TODO(xcsong): do punctuation if finish == true
if (finish == true && opts_.itn) {
if (nullptr != itn_resource) {
result = itn_resource->Normalize(result);
}
}
// if (finish == true && opts_.itn) {
// if (nullptr != itn_resource) {
// result = itn_resource->Normalize(result);
// }
// }
return result; return result;
} }

+ 1
- 1
post_processor/post_processor.h

@ -64,7 +64,7 @@ class PostProcessor {
void InitITNResource(const std::string& tagger_path, void InitITNResource(const std::string& tagger_path,
const std::string& verbalizer_path); const std::string& verbalizer_path);
private: private:
std::shared_ptr<PostProcessor> itn_resource = nullptr;
// std::shared_ptr<PostProcessor> itn_resource = nullptr;
const PostProcessOptions opts_; const PostProcessOptions opts_;
public: public:
WENET_DISALLOW_COPY_AND_ASSIGN(PostProcessor); WENET_DISALLOW_COPY_AND_ASSIGN(PostProcessor);

Loading…
Cancel
Save