Skip to content

Commit

Permalink
ensure empty language to direct output
Browse files Browse the repository at this point in the history
  • Loading branch information
nadar committed Mar 20, 2017
1 parent 5c1ba18 commit 14bbc83
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Stemm.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ class Stemm
*/
public static function stem($word, $language)
{
if (empty($language)) {
return $word;
}

foreach (static::$classMap as $stemmer => $languages) {
if (in_array($language, $languages)) {
return $stemmer::stem($word);
Expand Down

0 comments on commit 14bbc83

Please sign in to comment.