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

AI Hentai Generator
Generate AI Hentai for free.

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

In this chapter, we will understand the Environment Variables, General Configuration, Database Configuration and Email Configuration in CakePHP.

PHP 8.4 brings several new features, security improvements, and performance improvements with healthy amounts of feature deprecations and removals. This guide explains how to install PHP 8.4 or upgrade to PHP 8.4 on Ubuntu, Debian, or their derivati

To work with date and time in cakephp4, we are going to make use of the available FrozenTime class.

To work on file upload we are going to use the form helper. Here, is an example for file upload.

In this chapter, we are going to learn the following topics related to routing ?

CakePHP is an open-source framework for PHP. It is intended to make developing, deploying and maintaining applications much easier. CakePHP is based on a MVC-like architecture that is both powerful and easy to grasp. Models, Views, and Controllers gu

Validator can be created by adding the following two lines in the controller.

Visual Studio Code, also known as VS Code, is a free source code editor — or integrated development environment (IDE) — available for all major operating systems. With a large collection of extensions for many programming languages, VS Code can be c
