9 #ifndef META_PARSER_SR_PARSER_H_
10 #define META_PARSER_SR_PARSER_H_
14 #include <unordered_map>
79 std::random_device::result_type
seed = std::random_device{}();
136 void save(
const std::string& prefix)
const;
144 using std::runtime_error::runtime_error;
187 void load(
const std::string& prefix);
197 std::tuple<weight_vectors, uint64_t, uint64_t>
211 const parse_tree& tree,
const std::vector<trans_id>& transitions,
224 std::pair<uint64_t, uint64_t>
226 const std::vector<trans_id>& transitions,
239 const parse_tree& tree,
const std::vector<trans_id>& transitions,
253 bool check_legality =
false)
const;
255 using scored_trans = std::pair<trans_id, float>;
267 std::vector<scored_trans>
269 size_t num,
bool check_legality =
false)
const;