-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* First pass Allocs down to 75, ~double throughput? * One more * Better benchmark * Update to later Go version, lose the build cache * Add go.sum just to make the Actions cache happy * Rename sLen → suffixLength * Add name to contributors
- Loading branch information
1 parent
98e7b6e
commit 2569472
Showing
36 changed files
with
29,690 additions
and
29,669 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,18 @@ | ||
package english | ||
|
||
import ( | ||
"unicode/utf8" | ||
|
||
"github.com/kljensen/snowball/snowballword" | ||
) | ||
|
||
// Step 0 is to strip off apostrophes and "s". | ||
// | ||
func step0(w *snowballword.SnowballWord) bool { | ||
suffix, suffixRunes := w.FirstSuffix("'s'", "'s", "'") | ||
suffix := w.FirstSuffix("'s'", "'s", "'") | ||
if suffix == "" { | ||
return false | ||
} | ||
w.RemoveLastNRunes(len(suffixRunes)) | ||
suffixLength := utf8.RuneCountInString(suffix) | ||
w.RemoveLastNRunes(suffixLength) | ||
return true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.