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

Skip to content

Commit 221c193

Browse files
[PorterStemmer] Rename vowelinstem to use underscores for PEP 0008 compliance
1 parent 829b29a commit 221c193

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
@@ -397,8 +397,8 @@ def _step1b(self, word):
397397

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

0 commit comments

Comments
 (0)
0