diff options
-rw-r--r-- | pylint/checkers/spelling.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/pylint/checkers/spelling.py b/pylint/checkers/spelling.py index df99f6b3e..7493d6b02 100644 --- a/pylint/checkers/spelling.py +++ b/pylint/checkers/spelling.py @@ -110,7 +110,7 @@ class SphinxDirectives(Filter): return bool(self._pattern.match(word)) -class ForwardSlashChunkder(Chunker): +class ForwardSlashChunker(Chunker): """ This chunker allows splitting words like 'before/after' into 'before' and 'after' """ @@ -118,7 +118,7 @@ class ForwardSlashChunkder(Chunker): def next(self): while True: if not self._text: - raise StopIteration() + return if "/" not in self._text: text = self._text self._offset = 0 @@ -146,9 +146,9 @@ class ForwardSlashChunkder(Chunker): if not pre_text or not post_text: break if not pre_text[-1].isalpha() or not post_text[0].isalpha(): - raise StopIteration() + return self._text = pre_text + " " + post_text - raise StopIteration() + return class SpellingChecker(BaseTokenChecker): @@ -265,7 +265,7 @@ class SpellingChecker(BaseTokenChecker): self.tokenizer = get_tokenizer( dict_name, - chunkers=[ForwardSlashChunkder], + chunkers=[ForwardSlashChunker], filters=[ EmailFilter, URLFilter, |