⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 simplesplit.cpp

📁 自己写的简单分词程序
💻 CPP
字号:
#include <iostream>
#include "Dic.h"
#include "Split.h"
#include <algorithm>
using namespace std;



int main()
{
	Dic dic;
	Split split;
	
	//加载词典,如果加载失败,则此次运行失败
	if(dic.LoadDic() == true)
	{
		dic.ReadDic();//读入词典中的数据

		char Source[200] ="将待拆分的字符串分成单个字符,例如将“爱学习”分为“爱”,“学”,“习”";
		cout<<"待拆分字符串为:"<<endl<<Source<<endl;
	

		split.SplitString(Source);//将待拆分的字符串分成单个字符,例如将“爱学习”分为“爱”,“学”,“习”
		split.Seg(dic.DicArr);//开始进行分词

	//		输出分词结果
		//for(int i = 0; i <= split.getIndex(); i++)
		//{
		//	cout<<split.pResult[i]<<endl;
		//}
	}
	else
	{
		cout<<"Error in Loading Dic!"<<endl;
	}

	

	return 0;
}

⌨️ 快捷键说明

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