📄 loaddict.cs
字号:
namespace ClusterUsingKmeans
{
using System;
using System.Collections;
using System.IO;
using System.Text;
using System.Collections.Generic;
public class LoadDict
{
private Dictionary<string,string> _sogou = new Dictionary<string,string>() ;
private Dictionary<string,string> _sogou1 = new Dictionary<string,string> ();
private static bool instance_flag = false;
///加载词库
private LoadDict()
{
StreamReader reader = new StreamReader("SogouLabDic.dic", Encoding.Default);
string text = null;
while ((text = reader.ReadLine()) != null)
{
char[] separator = new char[] { '\t' };
string[] textArray = text.Split(separator);
this.sogou.Add(textArray[0], textArray[1]);
this.sogou1.Add(textArray[0], textArray[2]);
}
}
public static LoadDict getDict()
{
if (!instance_flag)
return new LoadDict();
else
return null;
}
public Dictionary<string, string> sogou
{
get
{
return this._sogou;
}
set
{
this._sogou = this.sogou;
}
}
public Dictionary<string, string> sogou1
{
get
{
return this._sogou1;
}
set
{
this._sogou1 = this.sogou1;
}
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -