Skip to content

Commit 908a11c

Browse files
committed
re-applied based on latest code - correct() updated to return None in case of correct word submit for test and str() for lack of suggestion, i.e. gibberish submit
1 parent 2f3cf5b commit 908a11c

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

language_tool_python/utils.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
"""Utility functions for the LanguageTool library."""
2+
13
from typing import List, Tuple, Optional
24
from shutil import which
35

@@ -71,6 +73,15 @@ class PathError(LanguageToolError):
7173
pass
7274

7375

76+
class RateLimitError(LanguageToolError):
77+
"""
78+
Exception raised for errors related to rate limiting in the LanguageTool server.
79+
This exception is a subclass of `LanguageToolError` and is used to indicate
80+
issues such as exceeding the allowed number of requests to the public API without a key.
81+
"""
82+
pass
83+
84+
7485
def parse_url(url_str: str) -> str:
7586
"""
7687
Parse the given URL string and ensure it has a scheme.
@@ -121,6 +132,7 @@ def correct(text: str, matches: List[Match]) -> str:
121132
else:
122133
return None
123134

135+
124136
def get_language_tool_download_path() -> str:
125137
"""
126138
Get the download path for LanguageTool.

0 commit comments

Comments
 (0)