dic.cpp

来自「自己写的简单分词程序」· C++ 代码 · 共 38 行

CPP
38
字号
#include "Dic.h"


Dic::Dic()
{
	this->pFile = NULL;
	this->iRepeatedNum = 0;
}

bool Dic::LoadDic()
{

	pFile = fopen("dict.txt","r");
	
	if(pFile == NULL)
	{
		return false;
	}
	else
	{
		return true;
	}
}

void Dic::ReadDic()
{

	 char buff[256];
	 char *pChTemp;
	 
	 while(fgets(buff,sizeof(buff)-1,pFile))
	 {
		pChTemp = strtok(buff,"\r\n\t");
		this->DicArr.push_back(pChTemp);
	 }
	 cout<<"Loading Dic is completing!"<<endl;
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?