Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

The Jieba Chinese Word Segmentation Implemented in Rust Bound for PHP.

License

NotificationsYou must be signed in to change notification settings

phper-framework/jieba-php

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Jieba 中文分词在 Rust 中实现,并为 PHP 提供绑定。

The Jieba Chinese Word Segmentation Implemented in Rust Bound for PHP.

Requirements

  • rust
  • php-dev

Build

# Optional, specify if php isn't installed globally.## export PHP_CONFIG=<Your path of php-config># Build libjieba.so.cargo build --release

Run

php -d"extension=target/release/libjieba.so" --ri jiebaphp -d"extension=target/release/libjieba.so" -r"print_r((new Jieba())->cut('我们中出了一个叛徒'));"

API

class Jieba {publicfunction__construct();publicfunctioncut(string$sentence,bool$hmm):array;publicfunctioncutForSearch(string$sentence,bool$hmm):array;publicfunctioncutAll(string$sentence):array;}

Examples

<?php$jieba =newJieba();$words =$jieba->cut("我们中出了一个叛徒",true);print_r($words);$words =$jieba->cutAll("我们中出了一个叛徒");print_r($words);$words =$jieba->cutForSearch("我们中出了一个叛徒");print_r($words);

License

MulanPSL-2.0

About

The Jieba Chinese Word Segmentation Implemented in Rust Bound for PHP.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages


[8]ページ先頭

©2009-2025 Movatter.jp