8000 [PorterStemmer] Rename vowelinstem to use underscores for PEP 0008 co… · ExplodingCabbage/nltk@1e843b7 · GitHub
[go: up one dir, main page]

Skip to content

Commit 1e843b7

Browse files
[PorterStemmer] Rename vowelinstem to use underscores for PEP 0008 compliance
1 parent 0cc197c commit 1e843b7

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

nltk/stem/porter.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -229,8 +229,8 @@ def _measure(self, stem):
229229
# docstring above, which is in turn equivalent to `m`
230230
return cv_sequence.count('vc')
231231

232-
def _vowelinstem(self, stem):
233-
"""vowelinstem(stem) is TRUE <=> stem contains a vowel"""
232+
def _contains_vowel(self, stem):
233+
"""_contains_vowel(stem) is TRUE <=> stem contains a vowel"""
234234
for i in range(len(stem)):
235235
if not self._cons(stem, i):
236236
return True
@@ -401,8 +401,8 @@ def _step1b(self, word):
401401

402402
rule_2_or_3_succeeded = False
403403
for rule in [
404-
('ed', '', self._vowelinstem), # (*v*) ED ->
405-
('ing', '', self._vowelinstem), # (*v*) ING ->
404+
('ed', '', self._contains_vowel), # (*v*) ED ->
405+
('ing', '', self._contains_vowel), # (*v*) ING ->
406406
]:
407407
try:
408408
intermediate_stem = self._replace_suffix_if(word, *rule)
@@ -450,7 +450,7 @@ def _step1c(self, word):
450450
'enjoy'. Step 1c is perhaps done too soon; but with this modification that
451451
no longer really matters.
452452
453-
Also, the removal of the vowelinstem(z) condition means that 'spy', 'fly',
453+
Also, the removal of the contains_vowel(z) condition means that 'spy', 'fly',
454454
'try' ... stem to 'spi', 'fli', 'tri' and conflate with 'spied', 'tried',
455455
'flies' ...
456456
"""

0 commit comments

Comments
 (0)
0