Skip to content

Commit

Permalink
Merge pull request #3 from Bartheyrman22/master
Browse files Browse the repository at this point in the history
Improvement: Add support for hunspell COMPOUND return type.
  • Loading branch information
Janusz Żukowicz authored Dec 19, 2016
2 parents d967ec2 + 76d33cc commit 7c936c3
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/HunspellPHP/Hunspell.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,14 @@ class Hunspell

const NONE = '#';

const COMPOUND = '-';

const STATUSES_NAME = [
Hunspell::OK => 'OK',
Hunspell::ROOT => 'ROOT',
Hunspell::MISS => 'MISS',
Hunspell::NONE => 'NONE',
Hunspell::COMPOUND => 'COMPOUND',
];

/**
Expand Down Expand Up @@ -155,7 +158,7 @@ protected function preParse($input, $words)
*/
protected function parse(array $matches)
{
if ($matches['type'] == Hunspell::OK) {
if ($matches['type'] == Hunspell::OK || $matches['type'] == Hunspell::COMPOUND) {
return new HunspellResponse(
$matches['input'],
$matches['input'],
Expand Down Expand Up @@ -212,4 +215,5 @@ protected function stemParse(array $matches)
}
return new HunspellStemResponse($input, $stems);
}

}

0 comments on commit 7c936c3

Please sign in to comment.