jxmorris12 / language_tool_python

a free python grammar checker 📝✅
GNU General Public License v3.0
434 stars 64 forks source link

Error: module 'language_tool_python' has no attribute 'check' #87

Closed Sombra-do-Baiano closed 7 months ago

Sombra-do-Baiano commented 7 months ago

I'm not sure if I'm doing something wrong but I have a code that looks like this, I'm sorry that some variables are in portuguese:

def corrigir_texto(entrada):
    corretor = ltpy.LanguageToolPublicAPI('pt-BR') 
    print(corretor.__dict__)
    print(dir(corretor))
    possiveis_correcoes = ltpy.check(entrada)
    ltpy.close()
    return possiveis_correcoes

and once I use the function it gives the error:

AttributeError: module 'language_tool_python' has no attribute 'check'

I've also tried using: corretor = ltpy.LanguageTool('pt-BR'). But in the end it showed the same error

jxmorris12 commented 7 months ago

Hi, I think you want to do corretor.check not ltpy.check here.