PHP Chinese word segmentation package: phpSplit is a Chinese word segmentation dictionary developed based on php.
Php word divider in the Unicode encoding dictionary
-
Applicable only to php5, required function iconv
-
This program uses the RMM reverse matching algorithm for word segmentation, and the dictionary needs to be specially compiled. this class provides the MakeDict () method.
-
Simple operation process: SetSource-> StartAnalysis-> GetResult
-
The main dictionary is encoded in a special format and does not need to be loaded into the memory.
Use
composer install
Require _ DIR __. '/vendor/autoload. php '; $ split = new Split (); var_dump ($ split-> simple ("Hello phpSplit"); $ this-> assertTrue (True );
Array (3) {[0] => string (0) "" [1] => string (6) "Hello" [2] => string (8) "phpSplit "}Description of suffix of word splitting result
Term n, time word t, place word s, acronyms f, number word m, quantifiers q, differentiation word B, pronoun r, verb v, adjective a, state word z, adverbs d, prefix p c, u, y, exclamation point e, anthropomorphic word o, Idiom I, exercise term l, j for short, front component h, rear component k, morphological g, non-morphological word x and punctuation mark w
My colleagues added the following three categories of tags: * names of private nouns (nr), place names (ns), group organization unit names (nt), and other private nouns (nz). * sub-class marks of phoneme, that is, the name is Ng, the dynamic element Vg, the description is Ag, the time is Tg, and the vice is Dg. * sub-class mark of the verb and the adjective, that is, name verb vn (a verb with nouns), name-form word an (an adjective with nouns), and associate verb vd (a verb with adverbs ), secondary word ad (adjectives with adverbs)
About 40 in total.
Project homepage:Http://www.open-open.com/lib/view/home/1448200861473