dict.h
来自「本系统实现了分词和倒排索引」· C头文件 代码 · 共 33 行
H
33 行
#ifndef _DICT_H
#define _DICT_H
#include <stdio.h>
#include <fstream>
#include <string>
#include <map>
#include "lexicon.h"
#define DICTFILENAME "dict.bin"
using namespace std;
class Dict
{
public:
Dict();
~Dict();
//bool GetFreq(string&) const {}//access freq
bool IsWord(string&) const;
void AddFreq(string&);
int get_id(string&);
private:
//map<string, int> dictMap;
map<string, int> dictMap;
//pair first int:id, second int:freq
void OpenDict();
};
#endif
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?