20 #ifndef FST_EXTENSIONS_FAR_CREATE_H_ 21 #define FST_EXTENSIONS_FAR_CREATE_H_ 36 int32_t generate_keys,
const std::string &key_prefix,
37 const std::string &key_suffix) {
38 for (
size_t i = 0; i < sources.size(); ++i) {
42 if (generate_keys > 0) {
43 std::ostringstream keybuf;
44 keybuf.width(generate_keys);
50 fst::make_unique_for_overwrite<char[]>(sources[i].size() + 1);
51 strcpy(source.get(), sources[i].c_str());
52 key = basename(source.get());
54 writer.
Add(key_prefix + key + key_suffix, *ifst);
60 #endif // FST_EXTENSIONS_FAR_CREATE_H_ void Create(const std::vector< std::string > &sources, FarWriter< Arc > &writer, int32_t generate_keys, const std::string &key_prefix, const std::string &key_suffix)
virtual void Add(std::string_view key, const Fst< Arc > &fst)=0