C# Class JiebaNet.Segmenter.JiebaSegmenter

Mostra file Open project: anderscui/jieba.NET Class Usage Examples

Private Properties

Property Type Description
AddBufferToWordList void
Calc Pair>.IDictionary
CutAll IEnumerable
CutDag IEnumerable
CutDagWithoutHmm IEnumerable
CutIt IEnumerable
GetDag List>.IDictionary

Public Methods

Method Description
AddWord ( string word, int freq, string tag = null ) : void
Cut ( string text, bool cutAll = false, bool hmm = true ) : IEnumerable

The main function that segments an entire sentence that contains Chinese characters into seperated words.

CutForSearch ( string text, bool hmm = true ) : IEnumerable
DeleteWord ( string word ) : void
JiebaSegmenter ( ) : System
LoadUserDict ( string userDictFile ) : void

Loads user dictionaries.

Tokenize ( string text, TokenizerMode mode = TokenizerMode.Default, bool hmm = true ) : IEnumerable

Private Methods

Method Description
AddBufferToWordList ( List words, string buf ) : void
Calc ( string sentence, IDictionary dag ) : Pair>.IDictionary
CutAll ( string sentence ) : IEnumerable
CutDag ( string sentence ) : IEnumerable
CutDagWithoutHmm ( string sentence ) : IEnumerable
CutIt ( string text, Func cutMethod, Regex reHan, Regex reSkip, bool cutAll ) : IEnumerable
GetDag ( string sentence ) : List>.IDictionary

Method Details

AddWord() public method

public AddWord ( string word, int freq, string tag = null ) : void
word string
freq int
tag string
return void

Cut() public method

The main function that segments an entire sentence that contains Chinese characters into seperated words.
public Cut ( string text, bool cutAll = false, bool hmm = true ) : IEnumerable
text string The string to be segmented.
cutAll bool Specify segmentation pattern. True for full pattern, False for accurate pattern.
hmm bool Whether to use the Hidden Markov Model.
return IEnumerable

CutForSearch() public method

public CutForSearch ( string text, bool hmm = true ) : IEnumerable
text string
hmm bool
return IEnumerable

DeleteWord() public method

public DeleteWord ( string word ) : void
word string
return void

JiebaSegmenter() public method

public JiebaSegmenter ( ) : System
return System

LoadUserDict() public method

Loads user dictionaries.
public LoadUserDict ( string userDictFile ) : void
userDictFile string
return void

Tokenize() public method

public Tokenize ( string text, TokenizerMode mode = TokenizerMode.Default, bool hmm = true ) : IEnumerable
text string
mode TokenizerMode
hmm bool
return IEnumerable