File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -81,6 +81,14 @@ def load_text_file(filename):
8181 return output
8282
8383
84+ def spell_check_words (spell_checker : SpellChecker , words : list [str ]):
85+ """Check each word and report False if at least one has an spelling error."""
86+ for word in words :
87+ if not spell_checker .check (word ):
88+ return False
89+ return True
90+
91+
8492def spell_check_comment (
8593 spell_checker : SpellChecker ,
8694 c : comment_parser .common .Comment ,
@@ -123,13 +131,8 @@ def spell_check_comment(
123131 if output_lvl > 1 :
124132 print (f"Trying splitting camel case word: { error .word } " )
125133 sub_words = splitCamelCase (error .word )
126- if len (sub_words ) > 1 :
127- ok_flag = True
128- for s in sub_words :
129- if not spell_checker .check (s ):
130- ok_flag = False
131- if ok_flag :
132- continue
134+ if len (sub_words ) > 1 and spell_check_words (spell_checker , sub_words ):
135+ continue
133136
134137 # Check for possessive words
135138 if error .word .endswith ("'s" ):
You can’t perform that action at this time.
0 commit comments