From ad343a8de1177f2a01cd1ae0dfae63c5c2898d36 Mon Sep 17 00:00:00 2001 From: BartH Date: Mon, 19 Dec 2016 15:25:25 +0100 Subject: [PATCH] Improvement: Add support for hunspell COMPOUND return type. --- src/HunspellPHP/Hunspell.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/HunspellPHP/Hunspell.php b/src/HunspellPHP/Hunspell.php index a314a23..ceaeb9b 100644 --- a/src/HunspellPHP/Hunspell.php +++ b/src/HunspellPHP/Hunspell.php @@ -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', ]; /** @@ -131,7 +134,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'], @@ -163,4 +166,4 @@ protected function parse(array $matches) throw new InvalidMatchTypeException(sprintf("Match type %s is invalid", $matches['type'])); } -} \ No newline at end of file +}