ranvis / php-mecab-ffi Goto Github PK
View Code? Open in Web Editor NEWPHP MeCab binding using FFI
License: BSD 2-Clause "Simplified" License
PHP MeCab binding using FFI
License: BSD 2-Clause "Simplified" License
@ranvis
Thank you for the great project for php8.*. I have been looking a php8 compatible mecab module for quite a long time, but none of them worked until now.
Is there any way to split the string using current project functions?
if yes, how to do it?
I used your example code snippets, and got the following output.
: BOS/EOS,*,*,*,*,*,*,*,* バナナはおやつに入りますか?: 名詞,固有名詞,一般,*,*,*,バナナはおやつに入りますか?,バナナハオヤツニハイリマスカ,バナナワオヤツニハイリマスカ : BOS/EOS,*,*,*,*,*,*,*,*
Obviously, the text is not split, is this correct?
if not, would you please add a split function? thank you very much.
I tested with php command line, and it worked as expected.
When I made an AJAX call to the server, apache server log showed the following error message.
Got error 'PHP message: PHP Fatal error: Uncaught FFI\\Exception: FFI API is restricted by "ffi.enable" configuration directive in /var/www/html/corpus/vendor/ranvis/mecab/src/Env.php:35\nStack trace:\n#0 /var/www/html/corpus/vendor/ranvis/mecab/src/Env.php(35): FFI::cdef()\n#1 /var/www/html/corpus/ngram.php(12): Ranvis\\MeCab\\Env->__construct()\n#2 /var/www/html/corpus/ngram.php(378): wbMecab->__construct()\n#3 {main}\n thrown in /var/www/html/corpus/vendor/ranvis/mecab/src/Env.php on line 35'
It seems to be related with ffi module.
Here is a list of php modules I have. Not sure what problem is it. Have you ever encountered similar error?
`[PHP Modules]
bz2
calendar
Core
ctype
curl
date
dom
exif
FFI
fileinfo
filter
ftp
gd
gettext
hash
iconv
json
libxml
mbstring
mysqli
mysqlnd
openssl
pcntl
pcre
PDO
pdo_mysql
Phar
posix
random
readline
Reflection
session
shmop
SimpleXML
sockets
sodium
SPL
standard
sysvmsg
sysvsem
sysvshm
tokenizer
xml
xmlreader
xmlwriter
xsl
Zend OPcache
zip
zlib
[Zend Modules]
Zend OPcache`
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.