PHP Chinese word segmentation package: phpSplit

Source: Internet
Author: User
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
  • Make sure that php is 5.3 +

  • Install composer

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.