📄 bihashtable.h
字号:
#pragma once
#include <string>
#include <hash_map>
using std::string ;
using stdext::hash_map ;
//a bidirectional-hash-table which can get id by word as well as get word by id
class BiHashTable
{
public:
BiHashTable() ;
bool GetIDByWord(const string& strWord, int& nId) ;
bool GetWordByID(int nId, string& strWord) ;
bool GetIDAndInsertByWord(const string& strWord, int &nId) ;
int GetCount() ;
bool Save(const string& strFilename) ;
bool Load(const string& strFilename) ;
private:
hash_map<string, int> m_Word2IdMap ;
hash_map<int, string> m_Id2WordMap ;
int m_count ;
};
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -