📄 zwfc.h
字号:
//---------------------------------------------------------------------------
#ifndef ZWFCH
#define ZWFCH
#include<iostream>
#include<fstream>
#include<vector>
#include<string>
#include<stack>
using namespace std;
//---------------------------------------------------------------------------
const int s1 = 0XB0,s2 = 0XA1,e1 = 0XF8,e2 = 0XFF;
const int maxwordlen = 50;
//---------------------------------------------------------------------------
struct Second
{
string key;
Second *next;
Second(string k = "",Second *n = 0):key(k),next(n){}
};
//---------------------------------------------------------------------------
struct Head
{
int size;
string key;
vector<Second*> W;
Head(string k = "",int s = 0):key(k),size(s){}
};
//---------------------------------------------------------------------------
class Dictiory
{
vector<Head> H;
ifstream fin;
ifstream fcin;
ofstream fout;
int hash[e1 - s1][e2 - s2];
int BinarySearch(string str,int k);
int GetNum();
void LoadDic();
bool IsC(char c);
bool IsEc(char c);
void AddWord(string str,int k);
void InsertWord(string str,int k);
bool IsWord(string str,int k,int t);
void SkipNotChinese(string &str,stack<string> &stk);
public:
string Sfilename;
string Dfilename;
Dictiory();
Dictiory(string sfilename,string dfilename);
void SegmentWord(string s);
void PrintDic();
};
//---------------------------------------------------------------------------
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -