https://github.com/amaccis/php-dict
A PHP DICT client
https://github.com/amaccis/php-dict
dict php-dict php74
Last synced: 4 months ago
JSON representation
A PHP DICT client
- Host: GitHub
- URL: https://github.com/amaccis/php-dict
- Owner: amaccis
- License: mit
- Created: 2020-11-18T23:07:13.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2021-11-10T21:59:51.000Z (over 3 years ago)
- Last Synced: 2025-01-19T21:49:39.491Z (6 months ago)
- Topics: dict, php-dict, php74
- Language: PHP
- Homepage:
- Size: 25.4 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# php-dict
[](https://img.shields.io/badge/php-%5E7.4-blue.svg)

# The DICT ProtocolAs per [RFC 2229](https://www.ietf.org/rfc/rfc2229.txt), the Dictionary Server Protocol (DICT) is a TCP transaction based query/response protocol that allows a client to access dictionary definitions from a set of natural language dictionary databases. For more details see [dict.org](http://www.dict.org/w/).
## Installation
php-dict is available on [Packagist](http://packagist.org/packages/amaccis/php-dict),
you can install it using [Composer](http://getcomposer.org).```shell
composer require amaccis/php-stemmer
```## Usage
```php
CommandInterface::COMMAND_DEFINE,
'word' => 'hacker',
'database' => 'jargon'
];
$response = $client->query('dict.org', $parameters);
var_dump($response);
/*
array(6) {
[0] =>
class Amaccis\Dict\Response\Response#358 (2) {
private $code =>
string(3) "220"
private $text =>
string(84) "dict dictd 1.12.1/rf on Linux 4.19.0-10-amd64 <534.2367.1605732508@dict>"
}
[1] =>
class Amaccis\Dict\Response\Response#357 (2) {
private $code =>
string(3) "250"
private $text =>
string(2) "ok"
}
[2] =>
class Amaccis\Dict\Response\Response#356 (2) {
private $code =>
string(3) "150"
private $text =>
string(23) "1 definitions retrieved"
}
[3] =>
class Amaccis\Dict\Response\Response#355 (2) {
private $code =>
string(3) "151"
private $text =>
string(2516) ""hacker" jargon "The Jargon File (version 4.4.7, 29 Dec 2003)"
hacker
n.[originally, someone who makes furniture with an axe]
1. A person who enjoys exploring the details of programmable systems and
how to stretch their capabilities, as opposed to most users, who prefer to
learn only the minimum necessary. RFC1392, the Internet Users' Glossary,
usefully amplifies this as: A person who delights in having an intimate
understanding of the internal workings of a system, com"...
}
[4] =>
class Amaccis\Dict\Response\Response#354 (2) {
private $code =>
string(3) "250"
private $text =>
string(41) "ok [d/m/c = 1/0/10; 0.000r 0.000u 0.000s]"
}
[5] =>
class Amaccis\Dict\Response\Response#353 (2) {
private $code =>
string(3) "221"
private $text =>
string(41) "bye [d/m/c = 0/0/0; 0.000r 0.000u 0.000s]"
}
}
*/
```## License
All files are MIT © [Andrea Maccis](https://twitter.com/andreamaccis)