|
|
@ -14,23 +14,13 @@ |
|
|
|
|
|
|
|
#include "wetext_processor.h"
|
|
|
|
#include <fst/string.h>
|
|
|
|
#include <fst/compat.h>
|
|
|
|
#include <fst/extensions/mpdt/compose.h>
|
|
|
|
#include <fst/extensions/mpdt/mpdt.h>
|
|
|
|
#include <fst/extensions/pdt/compose.h>
|
|
|
|
#include <fst/extensions/pdt/pdt.h>
|
|
|
|
#include <fst/extensions/pdt/shortest-path.h>
|
|
|
|
#include <fst/arc.h>
|
|
|
|
#include <fst/fstlib.h>
|
|
|
|
#include <fst/fst.h>
|
|
|
|
#include <fst/vector-fst.h>
|
|
|
|
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<StringCompiler<StdArc>>(fst::StringTokenType::BYTE); |
|
|
|
printer_ = std::make_shared<StringPrinter<StdArc>>(fst::StringTokenType::BYTE); |
|
|
|
compiler_ = std::make_shared<StringCompiler<StdArc>>(fst::TokenType::BYTE); |
|
|
|
printer_ = std::make_shared<StringPrinter<StdArc>>(fst::TokenType::BYTE); |
|
|
|
|
|
|
|
if (tagger_path.find("_tn_") != tagger_path.npos) { |
|
|
|
parse_type_ = ParseType::kTN; |
|
|
|