|
@ -13,14 +13,14 @@ |
|
|
// limitations under the License.
|
|
|
// limitations under the License.
|
|
|
|
|
|
|
|
|
#include "wetext_processor.h"
|
|
|
#include "wetext_processor.h"
|
|
|
#include <fst/string.h>
|
|
|
|
|
|
|
|
|
#include "fst/string.h"
|
|
|
namespace wetext { |
|
|
namespace wetext { |
|
|
Processor::Processor(const std::string& tagger_path, |
|
|
Processor::Processor(const std::string& tagger_path, |
|
|
const std::string& verbalizer_path) { |
|
|
const std::string& verbalizer_path) { |
|
|
tagger_.reset(StdVectorFst::Read(tagger_path)); |
|
|
tagger_.reset(StdVectorFst::Read(tagger_path)); |
|
|
verbalizer_.reset(StdVectorFst::Read(verbalizer_path)); |
|
|
verbalizer_.reset(StdVectorFst::Read(verbalizer_path)); |
|
|
compiler_ = std::make_shared<StringCompiler<StdArc>>(fst::TokenType::BYTE); |
|
|
|
|
|
printer_ = std::make_shared<StringPrinter<StdArc>>(fst::TokenType::BYTE); |
|
|
|
|
|
|
|
|
compiler_ = std::make_shared<StringCompiler<StdArc>>(fst::StringTokenType::BYTE); |
|
|
|
|
|
printer_ = std::make_shared<StringPrinter<StdArc>>(fst::StringTokenType::BYTE); |
|
|
|
|
|
|
|
|
if (tagger_path.find("_tn_") != tagger_path.npos) { |
|
|
if (tagger_path.find("_tn_") != tagger_path.npos) { |
|
|
parse_type_ = ParseType::kTN; |
|
|
parse_type_ = ParseType::kTN; |
|
|