phpcms 安装 SCWS分词扩展
SCWS 是 Simple Chinese Words Segmentation 的缩写,即简易中文分词系统。 这是一套基于词频词典的机械中文分词引擎,它能将一整段的汉字基本正确的切分成词。词是汉语的基本语素单位,而书写的时候不像英语会在词之间用空格分开,所以如何准确而又快速的分
SCWS 是 Simple Chinese Words Segmentation 的缩写,即简易中文分词系统。
这是一套基于词频词典的机械中文分词引擎,它能将一整段的汉字基本正确的切分成词。词是汉语的基本语素单位,而书写的时候不像英语会在词之间用空格分开,所以如何准确而又快速的分词一直是中文分词的攻关难点。
由于使用PHPCMS,网站配置中发现有这样一个自动的中文分词,好东西岂能不用。现将安装过程来详细记录,绝大部分文字资料都是来源于SCWS的官网,本人只是加入了一些实际操作过程中的不同,方便表述更加准确详细。
php_scws.dll/Win32 安装说明
1. 根据您当前用的 PHP 版本,下载相应已编译好的 php_scws.dll 扩展库。
目前支持 PHP-4.4.x 和 PHP-5.2.x 系列,下载地址分别为:
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. 将下载后的 zip 文件解压缩得到里面的 php_scws.dll ,将该文件放到 php 安装目录的
ext/ 目录中去(通常为:X:/php/ext/)。
3. 建立一个本地目录放规则集文件和词典文件,建议使用:C:/program files/scws/etc
4. 从 scws 主页上下载词典文件和规则集文件,解压后将 *.xdb 和 *.ini 放到上述目录中
规则集: http://www.ftphp.com/scws/down/scws-rules-all.zip
词典系列: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. 修改 php.ini 通常位于 C:/windows/php.ini 或 C:/winnt/php.ini 之类的目录,
在 php.ini 的末尾加入以下几行:
[scws]
;
; 注意请检查 php.ini 中的 extension_dir 的设定值是否正确, 否则请将 extension_dir 设为空,
; 再把 php_scws.dll 指定为绝对路径。
;
extension = php_scws.dll
scws.default.charset = gbk(utf版本请用utf8,不是utf-8)
scws.default.fpath = "c:/program files/scws/etc"
5. 重开 web 服务器即可完成。

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics











PHP and Python each have their own advantages, and choose according to project requirements. 1.PHP is suitable for web development, especially for rapid development and maintenance of websites. 2. Python is suitable for data science, machine learning and artificial intelligence, with concise syntax and suitable for beginners.

PHP is widely used in e-commerce, content management systems and API development. 1) E-commerce: used for shopping cart function and payment processing. 2) Content management system: used for dynamic content generation and user management. 3) API development: used for RESTful API development and API security. Through performance optimization and best practices, the efficiency and maintainability of PHP applications are improved.

PHP is a scripting language widely used on the server side, especially suitable for web development. 1.PHP can embed HTML, process HTTP requests and responses, and supports a variety of databases. 2.PHP is used to generate dynamic web content, process form data, access databases, etc., with strong community support and open source resources. 3. PHP is an interpreted language, and the execution process includes lexical analysis, grammatical analysis, compilation and execution. 4.PHP can be combined with MySQL for advanced applications such as user registration systems. 5. When debugging PHP, you can use functions such as error_reporting() and var_dump(). 6. Optimize PHP code to use caching mechanisms, optimize database queries and use built-in functions. 7

PHP is still dynamic and still occupies an important position in the field of modern programming. 1) PHP's simplicity and powerful community support make it widely used in web development; 2) Its flexibility and stability make it outstanding in handling web forms, database operations and file processing; 3) PHP is constantly evolving and optimizing, suitable for beginners and experienced developers.

PHP and Python each have their own advantages, and the choice should be based on project requirements. 1.PHP is suitable for web development, with simple syntax and high execution efficiency. 2. Python is suitable for data science and machine learning, with concise syntax and rich libraries.

PHP and Python have their own advantages and disadvantages, and the choice depends on project needs and personal preferences. 1.PHP is suitable for rapid development and maintenance of large-scale web applications. 2. Python dominates the field of data science and machine learning.

PHP is suitable for web development, especially in rapid development and processing dynamic content, but is not good at data science and enterprise-level applications. Compared with Python, PHP has more advantages in web development, but is not as good as Python in the field of data science; compared with Java, PHP performs worse in enterprise-level applications, but is more flexible in web development; compared with JavaScript, PHP is more concise in back-end development, but is not as good as JavaScript in front-end development.

PHP is mainly procedural programming, but also supports object-oriented programming (OOP); Python supports a variety of paradigms, including OOP, functional and procedural programming. PHP is suitable for web development, and Python is suitable for a variety of applications such as data analysis and machine learning.
