diff --git a/CMakeLists.txt b/CMakeLists.txt index c2a7729..173006b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -35,7 +35,6 @@ include_directories( ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/kaldi ) - # Build all libraries add_subdirectory(utils) add_subdirectory(frontend) diff --git a/post_processor/CMakeLists.txt b/post_processor/CMakeLists.txt index 6e416c2..228764b 100644 --- a/post_processor/CMakeLists.txt +++ b/post_processor/CMakeLists.txt @@ -1,18 +1,9 @@ message(STATUS "post_processor dir:${CMAKE_CURRENT_SOURCE_DIR}") -add_library(wetext_utils STATIC utils/wetext_string.cc) -target_link_libraries(wetext_utils PUBLIC glog) - -add_library(wetext_processor STATIC - processor/wetext_processor.cc - processor/wetext_token_parser.cc -) -target_link_libraries(wetext_processor PUBLIC dl fst wetext_utils) - -#add_executable(processor_main processor/processor_main.cc) -# -#target_link_libraries(processor_main PUBLIC wetext_processor) add_library(post_processor STATIC post_processor.cc + utils/wetext_string.cc + processor/wetext_processor.cc + processor/wetext_token_parser.cc ) -target_link_libraries(post_processor PUBLIC utils wetext_processor wetext_utils) +target_link_libraries(post_processor PUBLIC utils ${OPENFST_LIBRARYS}) diff --git a/post_processor/post_processor.cc b/post_processor/post_processor.cc index 4f070f8..b65010a 100644 --- a/post_processor/post_processor.cc +++ b/post_processor/post_processor.cc @@ -13,7 +13,7 @@ // See the License for the specific language governing permissions and // limitations under the License -#include "post_processor/post_processor.h" +#include "post_processor.h" #include #include #include "processor/wetext_processor.h" @@ -65,7 +65,7 @@ std::string PostProcessor::ProcessSpace(const std::string& str) { std::string del_substr(const std::string& str, const std::string& sub) { std::string result = str; int pos = 0; - while (string::npos != (pos = result.find(sub))) { + while (std::string::npos != (pos = result.find(sub))) { result.erase(pos, sub.size()); } return result; diff --git a/post_processor/processor/wetext_processor.cc b/post_processor/processor/wetext_processor.cc index b096bac..36a675a 100644 --- a/post_processor/processor/wetext_processor.cc +++ b/post_processor/processor/wetext_processor.cc @@ -13,16 +13,24 @@ // limitations under the License. #include "wetext_processor.h" - -using fst::StringTokenType; - +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include 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>(fst::StringTokenType::BYTE); + printer_ = std::make_shared>(fst::StringTokenType::BYTE); if (tagger_path.find("_tn_") != tagger_path.npos) { parse_type_ = ParseType::kTN;