https://github.com/hugsbrugs/php-synonym
PHP Synonym Utilities
https://github.com/hugsbrugs/php-synonym
php php-synonym synonym
Last synced: about 1 year ago
JSON representation
PHP Synonym Utilities
- Host: GitHub
- URL: https://github.com/hugsbrugs/php-synonym
- Owner: hugsbrugs
- Created: 2017-03-13T10:14:38.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2019-04-19T13:03:59.000Z (over 7 years ago)
- Last Synced: 2024-09-17T20:19:21.505Z (almost 2 years ago)
- Topics: php, php-synonym, synonym
- Language: PHP
- Size: 4.84 MB
- Stars: 5
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# php-synonym
This librairy allows one to get english and french synonyms
[](https://travis-ci.org/hugsbrugs/php-filesystem)
[](https://coveralls.io/github/hugsbrugs/php-synonym?branch=master)
## Install
Install package with composer
```
composer require hugsbrugs/php-synonym
```
In your PHP code, load librairy
```
require_once __DIR__ . '/../vendor/autoload.php';
use Hug\Synonym\Synonym as Synonym;
```
## Usage
Find Synonym
```
Synonym::find($word, $lang = 'en');
```
## Add other laguages
To add other languages
Download your thesaurus synonym dictionnary
Use one of these scripts
[mysql2sqlite](https://github.com/dumblob/mysql2sqlite)
[grfiv](https://gist.github.com/grfiv/b79ace3656113bcfbd9b7c7da8e9ae8d)
```
./mysql2sqlite.sh thesaurus_en.sql | sqlite3 thesaurus_en.db
```
## Unit Tests
```
composer exec phpunit
```
## Author
Hugo Maugey [visit my website ;)](https://hugo.maugey.fr)