spekulatius/keyword-merge
Composer 安装命令:
composer require spekulatius/keyword-merge
包简介
A helper to compare and merge similar keywords using PHP.
关键字:
README 文档
README
An helper to compare similarity of keywords or list of keyword.
You will still need to a make a final call which helper(s) to use and how to configure them.
This package is intended to be used with PHPScraper.
Sponsors
This project is sponsored by:
Want to sponsor this project? Contact me.
Install
composer require spekulatius/keyword-merge
At a glance
Here are a few impressions on the way the library works:
$kwcmp = new Spekulatius\KeywordMerge\KeywordComparator; $kwcmp->matchesWord('tbilisi georgia', 'is tbilisi the capital of georgia?'); // false $kwcmp->containsWord('tbilisi georgia', 'is tbilisi the capital of georgia?'); // true $kwcmp->similarWord('tbilisi georgia', 'georgias tbilisi'); // true
You call also use arrays with correlated methods:
$kwcmp = new Spekulatius\KeywordMerge\KeywordComparator; $kwcmp->matchesWords('tbilisi georgia', 'is tbilisi the capital of georgia?'); // [] $kwcmp->containsWords('tbilisi georgia', 'is tbilisi the capital of georgia?'); // ['is tbilisi the capital of georgia?'] $kwcmp->similarWords('tbilisi georgia', 'georgias tbilisi'); // ['georgias tbilisi']
Keywords in URL Path
The library can also test for keywords in the URL path:
$kwcmp = new Spekulatius\KeywordMerge\KeywordComparator; $kwcmp->inUrlPath('https://example.com/cats-are-awesome', 'seo tools'); // false $kwcmp->inUrlPath('https://example.com/seo-tools', 'seo tools'); // true $kwcmp->inUrlPath('https://example.com/chrome-seo-tools', 'chrome seo tools and toolkit'); // true - one word difference is accepted, from 3+ words
Further example and cases can be found in the tests!
Related Links
统计信息
- 总下载量: 625
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 10
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: GPL-3.0-or-later
- 更新时间: 2020-10-06