Skip to content

Commit 22337a9

Browse files
author
spirit
committed
Remove FIX_SENTENCES.
1 parent 7f235b0 commit 22337a9

1 file changed

Lines changed: 0 additions & 26 deletions

File tree

‎language_tool/__init__.py‎

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@
4545
"get_language_tool_dir", "set_language_tool_dir"]
4646

4747
FAILSAFE_LANGUAGE = "en"
48-
FIX_SENTENCES = False
4948
LANGUAGE_RE = re.compile(r"^([a-z]{2,3})(?:[_-]([a-z]{2}))?$", re.I)
5049
LANGUAGE_TAGS_MAPPING = {
5150
"English (Australian)": "en-AU",
@@ -118,31 +117,6 @@ def __getattr__(self, name):
118117
return None
119118

120119

121-
if FIX_SENTENCES:
122-
try:
123-
import translit
124-
except ImportError:
125-
translit = None
126-
import warnings
127-
warnings.warn("translit package is unavailable", ImportWarning)
128-
else:
129-
def fix_sentence(text, language=None):
130-
text = text.strip()
131-
if text[0].islower():
132-
text = text.capitalize()
133-
if text[-1] not in ".?!…,:;":
134-
text += "."
135-
text = translit.upgrade(text, language)
136-
return text
137-
138-
class Match(Match):
139-
def __init__(self, attrib, language=None):
140-
super().__init__(attrib, language)
141-
self.msg = fix_sentence(self.msg, language)
142-
self.replacements = [translit.upgrade(r, language)
143-
for r in self.replacements]
144-
145-
146120
class LanguageTool:
147121
"""Main class used for checking text against different rules
148122
"""

0 commit comments

Comments
 (0)