#ifndef PHONESET_H #define PHONESET_H #include #include #include #include #include "nlohmann/json.hpp" #define UNIT_BEG_SIL_SYMBOL "" #define UNIT_END_SIL_SYMBOL "" #define UNIT_BLK_SYMBOL "" using namespace std; namespace funasr { class PhoneSet { public: PhoneSet(const char *filename); ~PhoneSet(); int Size() const; int String2Id(string str) const; string Id2String(int id) const; bool Find(string str) const; int GetBegSilPhnId() const; int GetEndSilPhnId() const; int GetBlkPhnId() const; private: vector phone_; unordered_map phn2Id_; void LoadPhoneSetFromYaml(const char* filename); void LoadPhoneSetFromJson(const char* filename); }; } // namespace funasr #endif