Skip to content

Bump languagetool version to 6.6. #109

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 8, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions language_tool_python/download_lt.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
BASE_URL = os.environ.get('LTP_DOWNLOAD_HOST', 'https://www.languagetool.org/download/')
FILENAME = 'LanguageTool-{version}.zip'

LTP_DOWNLOAD_VERSION = '6.5'
LTP_DOWNLOAD_VERSION = '6.6'

JAVA_VERSION_REGEX = re.compile(
r'^(?:java|openjdk) version "(?P<major1>\d+)(|\.(?P<major2>\d+)\.[^"]+)"',
Expand Down Expand Up @@ -74,7 +74,7 @@ def confirm_java_compatibility() -> bool:
:return: True if the Java version is compatible.
:rtype: bool
"""

java_path = which('java')
if not java_path:
raise ModuleNotFoundError(
Expand Down Expand Up @@ -109,7 +109,7 @@ def get_common_prefix(z: zipfile.ZipFile) -> Optional[str]:
:return: The common prefix of all file names in the zip archive, or None if there is no common prefix.
:rtype: Optional[str]
"""

name_list = z.namelist()
if name_list and all(n.startswith(name_list[0]) for n in name_list[1:]):
return name_list[0]
Expand Down Expand Up @@ -152,7 +152,7 @@ def unzip_file(temp_file: str, directory_to_extract_to: str) -> None:
:param directory_to_extract_to: The directory where the contents of the zip file will be extracted.
:type directory_to_extract_to: str
"""

logger.info(f'Unzipping {temp_file.name} to {directory_to_extract_to}.')
with zipfile.ZipFile(temp_file.name, 'r') as zip_ref:
zip_ref.extractall(directory_to_extract_to)
Expand Down Expand Up @@ -184,11 +184,11 @@ def download_lt(language_tool_version: Optional[str] = LTP_DOWNLOAD_VERSION) ->
"""
Downloads and extracts the specified version of LanguageTool.
This function checks for Java compatibility, creates the necessary download
directory if it does not exist, and downloads the specified version of
directory if it does not exist, and downloads the specified version of
LanguageTool if it is not already present.
:param language_tool_version: The version of LanguageTool to download. If not
specified, the default version defined by

:param language_tool_version: The version of LanguageTool to download. If not
specified, the default version defined by
LTP_DOWNLOAD_VERSION is used.
:type language_tool_version: Optional[str]
:raises AssertionError: If the download folder is not a directory.
Expand Down
Loading