30 #define REGISTER_FST_OPERATION_4ARCS(Op, ArgPack) \ 31 REGISTER_FST_OPERATION_3ARCS(Op, ArgPack); \ 32 REGISTER_FST_OPERATION(Op, ErrorArc, ArgPack) 40 const std::string &symbols_source,
41 const std::string &unknown_symbol,
bool keep_symbols,
42 bool initial_symbols,
bool allow_negative_labels,
43 const std::string &key_prefix,
44 const std::string &key_suffix) {
55 allow_negative_labels,
58 Apply<Operation<FarCompileStringsArgs>>(
"CompileStrings", writer.
ArcType(),
65 std::string_view fst_type) {
67 Apply<Operation<FarConvertArgs>>(
"Convert", reader.
ArcType(), &args);
73 const int32_t generate_keys,
const std::string &key_prefix,
74 const std::string &key_suffix) {
75 FarCreateArgs args{sources, writer, generate_keys, key_prefix, key_suffix};
76 Apply<Operation<FarCreateArgs>>(
"Create", writer.
ArcType(), &args);
88 Apply<Operation<FarDecodeArgs>>(
"Decode", reader.
ArcType(), &args);
100 Apply<Operation<FarEncodeArgs>>(
"Encode", reader.
ArcType(), &args);
106 std::string_view begin_key, std::string_view end_key) {
110 Apply<Operation<FarEqualArgs>>(
"Equal", reader1.
ArcType(), &args_with_retval);
111 return args_with_retval.
retval;
117 const std::string &keys,
const std::string &key_separator,
118 const std::string &range_delimiter,
119 const std::string &source_prefix,
120 const std::string &source_suffix) {
122 key_separator, range_delimiter, source_prefix,
124 Apply<Operation<FarExtractArgs>>(
"Extract", reader.
ArcType(), &args);
129 void GetInfo(
const std::vector<std::string> &sources,
130 const std::string &arc_type,
const std::string &begin_key,
131 const std::string &end_key,
bool list_fsts,
FarInfoData *data) {
132 FarGetInfoArgs args{sources, begin_key, end_key, list_fsts, data};
133 Apply<Operation<FarGetInfoArgs>>(
"GetInfo", arc_type, &args);
138 void Info(
const std::vector<std::string> &sources,
const std::string &arc_type,
139 const std::string &begin_key,
const std::string &end_key,
141 FarInfoArgs args{sources, begin_key, end_key, list_fsts};
142 Apply<Operation<FarInfoArgs>>(
"Info", arc_type, &args);
148 std::string_view begin_key, std::string_view end_key) {
152 Apply<Operation<FarIsomorphicArgs>>(
"Isomorphic", reader1.
ArcType(),
154 return args_with_retval.
retval;
160 const TokenType token_type,
const std::string &begin_key,
161 const std::string &end_key,
bool print_key,
bool print_weight,
162 const std::string &symbols_source,
bool initial_symbols,
163 const int32_t generate_sources,
164 const std::string &source_prefix,
165 const std::string &source_suffix) {
167 begin_key, end_key, print_key,
168 print_weight, symbols_source, initial_symbols,
169 generate_sources, source_prefix, source_suffix};
170 Apply<Operation<FarPrintStringsArgs>>(
"PrintStrings", reader.
ArcType(),
void PrintStrings(FarReaderClass &reader, const FarEntryType entry_type, const TokenType token_type, const std::string &begin_key, const std::string &end_key, bool print_key, bool print_weight, const std::string &symbols_source, bool initial_symbols, const int32_t generate_sources, const std::string &source_prefix, const std::string &source_suffix)
void GetInfo(const std::vector< std::string > &sources, const std::string &arc_type, const std::string &begin_key, const std::string &end_key, bool list_fsts, FarInfoData *data)
std::tuple< const std::vector< std::string > &, const std::string &, const std::string &, const bool > FarInfoArgs
bool Equal(FarReaderClass &reader1, FarReaderClass &reader2, float delta, std::string_view begin_key, std::string_view end_key)
std::tuple< FarReaderClass &, FarReaderClass &, float, std::string_view, std::string_view > FarIsomorphicInnerArgs
bool Isomorphic(FarReaderClass &reader1, FarReaderClass &reader2, float delta, std::string_view begin_key, std::string_view end_key)
std::tuple< FarReaderClass &, FarWriterClass &, EncodeMapperClass * > FarEncodeArgs
std::tuple< FarReaderClass &, FarWriterClass &, std::string_view > FarConvertArgs
std::tuple< const std::vector< std::string > &, const std::string &, const std::string &, const bool, FarInfoData * > FarGetInfoArgs
std::tuple< FarReaderClass &, int32_t, const std::string &, const std::string &, const std::string &, const std::string &, const std::string & > FarExtractArgs
void Decode(FarReaderClass &reader, FarWriterClass &writer, const EncodeMapperClass &encoder)
bool ArcTypesMatch(const M &m, const N &n, const std::string &op_name)
void Info(const std::vector< std::string > &sources, const std::string &arc_type, const std::string &begin_key, const std::string &end_key, bool list_fsts)
std::tuple< FarReaderClass &, FarWriterClass &, const EncodeMapperClass & > FarDecodeArgs
void CompileStrings(const std::vector< std::string > &sources, FarWriterClass &writer, std::string_view fst_type, int32_t generate_keys, FarEntryType fet, TokenType tt, const std::string &symbols_source, const std::string &unknown_symbol, bool keep_symbols, bool initial_symbols, bool allow_negative_labels, const std::string &key_prefix, const std::string &key_suffix)
const std::string & ArcType() const
void Encode(FarReaderClass &reader, FarWriterClass &writer, EncodeMapperClass *encoder)
REGISTER_FST_OPERATION_4ARCS(CompileStrings, FarCompileStringsArgs)
std::tuple< FarReaderClass &, FarReaderClass &, float, std::string_view, std::string_view > FarEqualInnerArgs
void Create(const std::vector< std::string > &sources, FarWriterClass &writer, const int32_t generate_keys, const std::string &key_prefix, const std::string &key_suffix)
const std::string & ArcType() const
void Extract(FarReaderClass &reader, int32_t generate_sources, const std::string &keys, const std::string &key_separator, const std::string &range_delimiter, const std::string &source_prefix, const std::string &source_suffix)
void Convert(FarReaderClass &reader, FarWriterClass &writer, std::string_view fst_type)