C# Class Thrinax.NLP.Segment.ICTCLAS

基于多层隐马模型
PC单核测试 原词库:分词速度新闻文档300+每分钟 增加搜狗2006,人名、地名、成语、网络新名词库后,分词速度新闻文档300+每分钟
ファイルを表示 Open project: ziyunhx/thrinax Class Usage Examples

Public Properties

Property Type Description
wordSegment SharpICTCLAS.WordSegment

Private Properties

Property Type Description
ICTCLAS System
getPosTransformMap string>.Dictionary

Public Methods

Method Description
FindDifferent ( string NewDicFile, Encoding Encoding, DictionaryFormat DicFormat, SharpICTCLAS.WordDictionary SourceDict, string &OddLines, SharpICTCLAS.WordDictionary &NewWords, SharpICTCLAS.WordDictionary &ExistWords, double &MaxFrqRate, double &MinFrqRate, double &AvgFrqRate ) : void

找到导入库和现有库的不同

FindDifferent ( string NewDicFile, Encoding Encoding, DictionaryFormat DicFormat, string SourceDictFileName, string &OddLines, SharpICTCLAS.WordDictionary &NewWords, SharpICTCLAS.WordDictionary &ExistWords, double &MaxFrqRate, double &MinFrqRate, double &AvgFrqRate ) : void

找到导入库和现有库的不同

Generate2WordsTag ( string source ) : string[]

将源字符串分割成两两分割的Tag

ImportDictionary ( string ImportDicFile, Encoding ImportEncoding, string SourceDicFile, string DestDicFile, DictionaryFormat DicFormat, string &OddLines, double &AvgFrqRate, double ImportFrqRate ) : int

导入外部词库,词频按照重合词频比例平均值

Reload ( string DataPath = null ) : void

运行时重新加载词库,初始化分词器

Splite ( string Input, bool PosTagged = false, HashSet RemainPos = null, HashSet StopWords = null, int MinLength, int MaxLength = 100 ) : string

分词函数(返回一个空格分隔的String)

SpliteIntoArray ( string Input, HashSet RemainPos, HashSet StopWords, int MinLength, int MaxLength, bool PosTagged = false ) : string[]

分词函数

Private Methods

Method Description
ICTCLAS ( ) : System
getPosTransformMap ( DictionaryFormat DicFormat ) : string>.Dictionary

返回特定词典格式的词性转换映射

Method Details

FindDifferent() public static method

找到导入库和现有库的不同
public static FindDifferent ( string NewDicFile, Encoding Encoding, DictionaryFormat DicFormat, SharpICTCLAS.WordDictionary SourceDict, string &OddLines, SharpICTCLAS.WordDictionary &NewWords, SharpICTCLAS.WordDictionary &ExistWords, double &MaxFrqRate, double &MinFrqRate, double &AvgFrqRate ) : void
NewDicFile string 导入库文件
Encoding System.Text.Encoding 导入库文件编码
DicFormat DictionaryFormat 导入库文件格式
SourceDict SharpICTCLAS.WordDictionary 原库对象
OddLines string 输出没有词性标注且现有库中也没有的词行
NewWords SharpICTCLAS.WordDictionary 输出新词或现有词的新词性
ExistWords SharpICTCLAS.WordDictionary 输出重复词,且词性也相同
MaxFrqRate double 重复词的最大词频比例
MinFrqRate double 重复词的最小词频比例
AvgFrqRate double 重复词的平均词频比例
return void

FindDifferent() public static method

找到导入库和现有库的不同
public static FindDifferent ( string NewDicFile, Encoding Encoding, DictionaryFormat DicFormat, string SourceDictFileName, string &OddLines, SharpICTCLAS.WordDictionary &NewWords, SharpICTCLAS.WordDictionary &ExistWords, double &MaxFrqRate, double &MinFrqRate, double &AvgFrqRate ) : void
NewDicFile string 导入库文件
Encoding System.Text.Encoding 导入库文件编码
DicFormat DictionaryFormat 导入库文件格式
SourceDictFileName string 原库文件
OddLines string 输出没有词性标注且现有库中也没有的词行
NewWords SharpICTCLAS.WordDictionary 输出新词或现有词的新词性
ExistWords SharpICTCLAS.WordDictionary 输出重复词,且词性也相同
MaxFrqRate double 重复词的最大词频比例
MinFrqRate double 重复词的最小词频比例
AvgFrqRate double 重复词的平均词频比例
return void

Generate2WordsTag() public static method

将源字符串分割成两两分割的Tag
public static Generate2WordsTag ( string source ) : string[]
source string 源字符串
return string[]

ImportDictionary() public static method

导入外部词库,词频按照重合词频比例平均值
public static ImportDictionary ( string ImportDicFile, Encoding ImportEncoding, string SourceDicFile, string DestDicFile, DictionaryFormat DicFormat, string &OddLines, double &AvgFrqRate, double ImportFrqRate ) : int
ImportDicFile string 外部词库文件名
ImportEncoding System.Text.Encoding 外部词库文件编码
SourceDicFile string 源dct文件名
DestDicFile string 目标dct文件名
DicFormat DictionaryFormat 外部词库类型
OddLines string 导入的库中无效且不在源库中的数据
AvgFrqRate double 导入文件的平均频度比例
ImportFrqRate double 设置固定的导入文件频度比例(除以此数字后入库,小于等于0则按照AvgFrqRate入库)
return int

Reload() public static method

运行时重新加载词库,初始化分词器
public static Reload ( string DataPath = null ) : void
DataPath string 分词器所需文件的文件夹,空则加载默认
return void

Splite() public static method

分词函数(返回一个空格分隔的String)
public static Splite ( string Input, bool PosTagged = false, HashSet RemainPos = null, HashSet StopWords = null, int MinLength, int MaxLength = 100 ) : string
Input string 输入字符串
PosTagged bool 是否标注词性(如果是增加词性后缀如"/n")
RemainPos HashSet 仅保留这些词性的词
StopWords HashSet 禁止词列表(小写)
MinLength int 最短词长度
MaxLength int 最长词长度
return string

SpliteIntoArray() public static method

分词函数
public static SpliteIntoArray ( string Input, HashSet RemainPos, HashSet StopWords, int MinLength, int MaxLength, bool PosTagged = false ) : string[]
Input string 输入字符串
RemainPos HashSet
StopWords HashSet 禁止词列表(小写)
MinLength int 最短词长度
MaxLength int 最长词长度
PosTagged bool 是否标注词性(如果是增加词性后缀如"/n")
return string[]

Property Details

wordSegment public_oe property

public WordSegment,SharpICTCLAS wordSegment
return SharpICTCLAS.WordSegment