20 #ifndef FST_EXTENSIONS_FAR_CREATE_H_ 21 #define FST_EXTENSIONS_FAR_CREATE_H_ 40 int32_t generate_keys,
const std::string &key_prefix,
41 const std::string &key_suffix) {
42 for (
size_t i = 0; i < sources.size(); ++i) {
46 if (generate_keys > 0) {
47 std::ostringstream keybuf;
48 keybuf.width(generate_keys);
54 fst::make_unique_for_overwrite<char[]>(sources[i].size() + 1);
55 strcpy(source.get(), sources[i].c_str());
56 key = basename(source.get());
58 writer.
Add(key_prefix + key + key_suffix, *ifst);
64 #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