sjaakmoes/elasticsearch-langdetect-php
最新稳定版本:1.0.0
Composer 安装命令:
composer require sjaakmoes/elasticsearch-langdetect-php
包简介
Langdetect namespace for Elasticsearch-PHP
README 文档
README
This module adds endpoints to the Elasticsearch-PHP library when you are using the elasticsearch-langdetect plugin.
Installation
This module can be installed with Composer.
Add the elasticsearch-langdetect-php package to your composer.json file:
{
"require": {
"sjaakmoes/elasticsearch-langdetect-php": "~1.0"
}
}
After the module is installed through composer, we need to inject this module into the Elasticsearch-PHP library:
$params = [ 'host' => ['localhost:9200'], 'customNamespaces' => [ 'langdetect' => 'Langdetect\LangdetectNamespace' ] ]; $client = new Elasticsearch\Client($params);
Use
Language detection:
// Detect $params = [ 'content' => 'This is a sample text.' ]; $response = $client->langdetect()->detect($params);
The $response holds an array which looks like:
Array
(
[profile] => /langdetect/
[languages] => Array
(
[0] => Array
(
[language] => en
[probability] => 0.9999959428847
)
)
)
统计信息
- 总下载量: 21
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2015-09-30