Questions about pscws4 word segmentation-php Tutorial

Source: Internet
Author: User
Pscws4 is used for pscws4 word segmentation. why do we print only the numbers in the text and print them without word segmentation? the webpage code is utf8function get_tags_arr ($ title) {require pscws4pscws4. class. php; $ pscws new PSCWS4 (); $ pscws-& gt; se about pscws4 word segmentation
Pscws4 is used for word segmentation. Why does one print only the numbers in the text and print them without word segmentation? the webpage code is utf8.

Function get_tags_arr ($ title ){
Require 'pscws4/pscws4.class. php ';
$ Pscws = new PSCWS4 ();
$ Pscws-> set_dict ('scws/dict. utf8.xdb ');
$ Pscws-> set_rule ('scws/rules. utf8.ini ');
$ Pscws-> set_ignore (true );
$ Pscws-> send_text ($ title );
$ Words = $ pscws-> get_tops (10 );
$ Tags = array ();
Foreach ($ words as $ val ){
$ Tags [] = $ val ['word'];
}
$ Pscws-> close ();
Return $ tags;
}
------------------------------------
$ Title = and abide by the relevant laws and regulations of the People's Republic of China, 21343 respecting online ethics;
$ Tags = get_tags_arr ($ title );
Echo print_r ($ tags );

Why do I print only the numbers in it?


------ Solution --------------------
$ Pscws-> set_dict ('scws/dict. utf8.xdb ');
$ Pscws-> set_rule ('scws/rules. utf8.ini ');
Are these two file names and paths correct?

For php 5.3 and later, there will be a Redefining already defined constructor error. enabling the error prompt does not affect normal operation.

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.