language_tool_python icon indicating copy to clipboard operation
language_tool_python copied to clipboard

Errno 111

Open sdspieg opened this issue 1 year ago • 0 comments

When running this code `import language_tool_python import pandas as pd from tqdm.auto import tqdm

tool = language_tool_python.LanguageTool('en-US') tool._url = 'http://localhost:9888/v2/' # Manually set the server URL

def count_grammar_mistakes(text): matches = tool.check(text) return len(matches)

sample_text = "I wants much foods" print(f"Number of grammar mistakes in the sample text: {count_grammar_mistakes(sample_text)}") `

I get this error:

LanguageToolError: http://localhost:9888/v2/: HTTPConnectionPool(host='localhost', port=9888): Max retries exceeded with url: /v2/check?language=en-US&text=I+wants+many+foods (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused')) This is on a Windows machine, running the code from a Jupyter Notebook in VSC under WSL. The server is up and works when I feed it http://localhost:9888/v2/check?language=en-US&text=I+wants+much+foods This happens even when I pause my firewall for a few minutes. Any ideas?

sdspieg avatar Aug 15 '23 23:08 sdspieg