?? dict.cpp
字號:
// Dict handling
#include "Dict.h"
CDict::CDict()
{
OpenDict();
}
CDict::~CDict()
{
mapDict.clear();
}
void CDict::OpenDict()
{
FILE *fpDict;
if ((fpDict = fopen(DICTFILENAME.c_str(), "r")) == NULL) {
cout << "Can not open the Dictionary file!";
exit(1);
}
int id, freq;
char word[16];
while (fscanf(fpDict, "%d %s %d", &id, word, &freq) != EOF) {
//fscanf(fpDict, "%d %s %d", &id, word, &freq);
mapDict.insert(map<string,int>::value_type (word, 0));
}
fclose(fpDict);
}
bool CDict::IsWord(string& str) const
{
if (mapDict.find(str) != mapDict.end())
return true;
return false;
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -