atomescrochus/laravel-string-similarities 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

atomescrochus/laravel-string-similarities

最新稳定版本:2.1.0

Composer 安装命令:

composer require atomescrochus/laravel-string-similarities

包简介

Compare two string and get a similarity percentage

README 文档

README

Latest Stable Version License Total Downloads

Compare two string and get a similarity percentage. Note that I did not write the algorithms myself, see down this document for the full credits.

Some methods are usable in production, some are not, see usage for informations. Pull requests are more than welcomed!

Install

You can install this package via composer:

$ composer require atomescrochus/laravel-string-similarities

Then you have to install the package' service provider, unless you are running Laravel >=5.5 (it'll use package auto-discovery) :

// config/app.php
'providers' => [
    ...
    Atomescrochus\StringSimilarities\StringSimilaritiesServiceProvider::class,
];

Usage

$comparison = new \Atomescrochus\StringSimilarities\Compare();

// the functions returns similarity percentage between strings
$jaroWinkler = $comparison->jaroWinkler('first string', 'second string'); // JaroWinkler comparison
$levenshtein = $comparison->levenshtein('first string', 'second string'); // Levenshtein comparison
$smg = $comparison->smg('first string', 'second string'); // Smith Waterman Gotoh comparison
$similar = $comparison->similarText('first string', 'second string'); // Using "similar_text()"

// This next one will return an array containing the results of all working comparison methods
// plus an array of 'data' that includes the first and second string, and the time in second it took to run all
// comparison. BE AWARE that comparing long string can results in really long compute time!
$all = $comparison->all('first string', 'second string');

Change log

Please see CHANGELOG for more information on what has changed recently.

Testing

HELP NEEDED.

Contributing

Please see CONTRIBUTING and CONDUCT for details.

Security

If you discover any security related issues, please email jp@atomescroch.us instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.

统计信息

  • 总下载量: 143.84k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 70
  • 点击次数: 1
  • 依赖项目数: 3
  • 推荐数: 0

GitHub 信息

  • Stars: 69
  • Watchers: 4
  • Forks: 19
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2017-01-08