Install SCWS word segmentation extension in phpcms

Source: Internet
Author: User
SCWS is short for SimpleChineseWordsSegmentation, which is a simple Chinese Word Segmentation System. This is a set of mechanical Chinese Word Segmentation Engines Based on Word Frequency dictionaries. It can divide a full range of Chinese characters into words. Words are the basic units of Chinese characters, but they are not separated by spaces in English, so how to accurately and quickly

SCWS is short for Simple Chinese Words Segmentation, which is a Simple Chinese Word Segmentation System. This is a set of mechanical Chinese Word Segmentation Engines Based on Word Frequency dictionaries. It can divide a full range of Chinese characters into words. Words are the basic units of Chinese characters, but they are not separated by spaces in English, so how to accurately and quickly

SCWS is short for Simple Chinese Words Segmentation, which is a Simple Chinese Word Segmentation System.

This is a set of mechanical Chinese Word Segmentation Engines Based on Word Frequency dictionaries. It can divide a full range of Chinese characters into words. Words are the basic units of Chinese characters. Unlike English Words, words are separated by spaces. Therefore, accurate and fast word segmentation has always been a challenge for Chinese word segmentation.

Due to the use of PHPCMS, the website configuration found such an automatic Chinese word segmentation, good things can not be used. Now we will record the installation process in detail. Most of the text is from the official website of SCWS. I just added some differences in the actual operation process to facilitate more accurate and detailed expressions.

Install php_scws.dll/Win32

1. Download the compiled php_scws.dll extension library based on your current PHP version.
Currently supports the PHP-4.4.x and PHP-5.2.x series, respectively:

Php-4.4.x: http://www.ftphp.com/scws/down/scws-1.0.0_win32_php-4.4.x.zip
Php-5.2.x: http://www.ftphp.com/scws/down/scws-1.0.0_win32_php-5.2.x.zip

2. decompress the downloaded zip file to obtain php_scws.dll, and place the file in the php installation directory.
Go to the ext/directory (usually X:/php/ext /).

3. Create a local directory to store rule set files and dictionary files. We recommend that you use C:/program files/scws/etc.

4. Download the dictionary files and rule set files from the scws homepage, decompress the files, and put *. xdb and *. ini in the preceding directory.
Rule Set: http://www.ftphp.com/scws/down/scws-rules-all.zip
Dictionary generation: http://www.ftphp.com/scws/down/scws-dict-chs-gbk.tar.bz2
Http://www.ftphp.com/scws/down/scws-dict-chs-utf8.tar.bz2
Http://www.ftphp.com/scws/down/scws-dict-cht-utf8.tar.bz2

4. Modify php. ini to a directory such as C:/windows/php. ini or C:/winnt/php. ini,
Add the following lines to the end of php. ini:

[Scws]
;
Check whether the set value of extension_dir in php. ini is correct. Otherwise, set extension_dir to null,
And then specify php_scws.dll as the absolute path.
;
Extension = php_scws.dll
Scws. default. charset = gbk (utf8 is recommended for utf versions, not UTF-8)
Scws. default. fpath = "c:/program files/scws/etc"

5. Restart the web server.

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.