Created
February 10, 2020 18:03
-
-
Save Sirsirious/593f34974946f89b2585e47aaec09934 to your computer and use it in GitHub Desktop.
Step 3 of porter Stemmer.
This file contains hidden or 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
| def _porter_step_3(self, stem): | |
| pair_tests = [('icate','ic'),('ative',''),('alize','al'),('iciti','ic'),('ical','ic'),('ful',''),('ness','')] | |
| if self._det_m(stem) > 0: | |
| for term, subs in pair_tests: | |
| if stem.endswith(term): | |
| return stem[:-len(term)]+subs | |
| return stem |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment