Skip to content

Commit f7156a6

Browse files
committed
feat(download_lt): added a new way to handle LT downloads
1 parent afa28a8 commit f7156a6

7 files changed

Lines changed: 764 additions & 119 deletions

File tree

README.md

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -279,15 +279,27 @@ If LanguageTool is already installed on your system, you can defined the followi
279279
$ export LTP_JAR_DIR_PATH = /path/to/the/language/tool/jar/files
280280
```
281281

282-
Overwise, `language_tool_python` can download LanguageTool for you automatically.
282+
Otherwise, `language_tool_python` can download LanguageTool for you automatically.
283283

284-
To overwrite the host part of URL that is used to download LanguageTool-{version}.zip:
284+
To overwrite the host part of URL that is used to download LanguageTool, use one of these environment variables depending on your version type:
285285

286286
```bash
287-
$ export LTP_DOWNLOAD_HOST = [alternate URL]
287+
# For snapshot/nightly versions (e.g., 'latest', '20240101')
288+
$ export LTP_DOWNLOAD_HOST_SNAPSHOT = [alternate snapshot URL]
289+
290+
# For release versions >= 6.0 (e.g., '6.0', '6.5')
291+
$ export LTP_DOWNLOAD_HOST_RELEASE = [alternate release URL]
292+
293+
# For release versions < 6.0 from the archive
294+
$ export LTP_DOWNLOAD_HOST_ARCHIVE = [alternate archive URL]
288295
```
289296

290-
This can be used to downgrade to an older version, for example, or to download from a mirror.
297+
The default URLs are:
298+
- Snapshots: `https://internal1.languagetool.org/snapshots/`
299+
- Releases: `https://languagetool.org/download/`
300+
- Archive: `https://languagetool.org/download/archive/`
301+
302+
This can be used to download from a mirror or specify a custom repository.
291303

292304
And to choose the specific folder to download the server to:
293305

@@ -300,7 +312,7 @@ The default download path is `~/.cache/language_tool_python/`. The LanguageTool
300312
## Prerequisites
301313

302314
- [Python 3.9+](https://www.python.org)
303-
- [LanguageTool](https://www.languagetool.org) (Java 8.0 or higher for version <= 6.5, Java 17.0 or higher for version >= 6.6)
315+
- [LanguageTool](https://www.languagetool.org) (Java 9.0 or higher for version <= 6.5, Java 17.0 or higher for version >= 6.6)
304316

305317
The installation process should take care of downloading LanguageTool (it may
306318
take a few minutes). Otherwise, you can manually download
@@ -309,7 +321,7 @@ into where the ``language_tool_python`` package resides.
309321

310322
### LanguageTool Version
311323

312-
LanguageTool versions under 6.0 are no longer downloadable from the LanguageTool website. If you need to use an older version, you can download it from the [LanguageTool GitHub tags page](https://github.com/languagetool-org/languagetool/tags) and build it yourself.
324+
LanguageTool versions under 4.0 are not supported since it implies a lot of differences in the API.
313325

314326
### Acknowledgements
315327

coverage-badge.svg

Lines changed: 1 addition & 1 deletion
Loading

0 commit comments

Comments
 (0)