Skip to content

Commit

Permalink
fix panics on certain inputs triggered in rule 5a
Browse files Browse the repository at this point in the history
originally reported in identified by reiver#4
  • Loading branch information
mschoch committed Oct 20, 2014
1 parent 59eb481 commit c5e9efb
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions porterstemmer.go
Original file line number Diff line number Diff line change
Expand Up @@ -789,8 +789,10 @@ func step5a(s []rune) []rune {

if 1 < m {
result = subSlice
} else if c := subSlice[len(subSlice)-1] ; 1 == m && !( hasConsonantVowelConsonantSuffix(subSlice) && 'w' != c && 'x' != c && 'y' != c) {
result = subSlice
} else if 1 == m {
if c := subSlice[len(subSlice)-1] ; !( hasConsonantVowelConsonantSuffix(subSlice) && 'w' != c && 'x' != c && 'y' != c) {
result = subSlice
}
}
}

Expand Down

0 comments on commit c5e9efb

Please sign in to comment.