20260731 - first commit
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
import language_tool_python
|
||||
import os, sys
|
||||
|
||||
|
||||
tool = language_tool_python.LanguageTool('es')
|
||||
|
||||
|
||||
#mierda de perro
|
||||
|
||||
text = """
|
||||
Ayer fuimos al playa y comimos mucho pescados.
|
||||
"""
|
||||
|
||||
if len(sys.argv)>=2:
|
||||
|
||||
nombre_fichero = sys.argv[1]
|
||||
if os.path.isfile(nombre_fichero):
|
||||
print(f"Leyendo fichero '{nombre_fichero}'")
|
||||
text = ""
|
||||
with open(nombre_fichero, 'r', encoding='ISO-8859-1') as infile:
|
||||
for line in infile:
|
||||
text += line
|
||||
|
||||
matches = tool.check(text)
|
||||
|
||||
for match in matches:
|
||||
print(f"Rule: {match.rule_id}")
|
||||
print(f"Message: {match.message}")
|
||||
print(f"Error: '{text[match.offset:match.offset+match.error_length]}'")
|
||||
print("Suggestions:", match.replacements)
|
||||
print()
|
||||
|
||||
Reference in New Issue
Block a user