Skip to content

Commit bba1b5a

Browse files
committed
Rename
1 parent 0a0f605 commit bba1b5a

14 files changed

Lines changed: 66 additions & 70 deletions

‎README.rst‎

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,23 @@
1-
language-tool
2-
=============
1+
language-check
2+
==============
33

44
Python wrapper for LanguageTool.
55

6-
.. image:: https://travis-ci.org/myint/language-tool.png?branch=master
7-
:target: https://travis-ci.org/myint/language-tool
6+
.. image:: https://travis-ci.org/myint/language-check.png?branch=master
7+
:target: https://travis-ci.org/myint/language-check
88
:alt: Build status
99

10+
This is a fork of
11+
https://bitbucket.org/spirit/language_tool that produces more easily parsable
12+
results from the command-line.
1013

1114
Example usage
1215
-------------
1316

14-
>>> import language_tool
15-
>>> lang_tool = language_tool.LanguageTool("en-US")
17+
>>> import language_check
18+
>>> lang_check = language_check.LanguageTool("en-US")
1619
>>> text = "A sentence with a error in the Hitchhiker’s Guide tot he Galaxy"
17-
>>> matches = lang_tool.check(text)
20+
>>> matches = lang_check.check(text)
1821
>>> len(matches)
1922
2
2023

@@ -43,7 +46,7 @@ Suggestion: to the
4346

4447
Automatically apply suggestions to the text:
4548

46-
>>> language_tool.correct(text, matches)
49+
>>> language_check.correct(text, matches)
4750
'A sentence with an error in the Hitchhiker’s Guide to the Galaxy'
4851

4952

@@ -54,13 +57,6 @@ To install the package for Python 3, use::
5457

5558
$ ./setup.py install
5659

57-
To install the package for Python 2, use::
58-
59-
$ python2 setup.py install
60-
61-
On Windows, you may use one of the MSI binary packages provided on the
62-
`download page <https://bitbucket.org/spirit/language_tool/downloads>`_.
63-
6460

6561
Prerequisites
6662
-------------
@@ -75,6 +71,6 @@ The installation process should take care of downloading LanguageTool
7571
(it may take a few minutes).
7672
Otherwise, you can manually download `LanguageTool-stable.zip
7773
<http://www.languagetool.org/download/LanguageTool-stable.zip>`_
78-
and unzip it into where the ``language_tool`` package resides.
74+
and unzip it into where the ``language_check`` package resides.
7975

8076
LanguageTool requires Java 6 or later.

‎download_lt.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232

3333
BASE_URL = 'http://www.languagetool.org/download/'
3434
FILENAME = 'LanguageTool-2.2.zip'
35-
PACKAGE_PATH = 'language_tool'
35+
PACKAGE_PATH = 'language_check'
3636

3737

3838
if NormalizedVersion:
File renamed without changes.
Lines changed: 23 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,22 @@
11
# -*- coding: utf-8 -*-
2-
"""LanguageTool through server mode."""
32

4-
# © 2012 spirit <hiddenspirit@gmail.com>
5-
# https://bitbucket.org/spirit/language_tool
3+
# © 2012 spirit <hiddenspirit@gmail.com>
4+
# © 2013-2014 Steven Myint
65
#
7-
# This program is free software: you can redistribute it and/or modify it
8-
# under the terms of the GNU Lesser General Public License as published
9-
# by the Free Software Foundation, either version 3 of the License,
10-
# or (at your option) any later version.
6+
# This program is free software: you can redistribute it and/or modify it
7+
# under the terms of the GNU Lesser General Public License as published
8+
# by the Free Software Foundation, either version 3 of the License,
9+
# or (at your option) any later version.
1110
#
12-
# This program is distributed in the hope that it will be useful,
13-
# but WITHOUT ANY WARRANTY; without even the implied warranty
14-
# of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
15-
# See the GNU Lesser General Public License for more details.
11+
# This program is distributed in the hope that it will be useful,
12+
# but WITHOUT ANY WARRANTY; without even the implied warranty
13+
# of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
14+
# See the GNU Lesser General Public License for more details.
1615
#
17-
# You should have received a copy of the GNU Lesser General Public License
18-
# along with this program. If not, see <http://www.gnu.org/licenses/>.
16+
# You should have received a copy of the GNU Lesser General Public License
17+
# along with this program. If not, see <http://www.gnu.org/licenses/>.
18+
19+
"""LanguageTool through server mode."""
1920

2021
import atexit
2122
import glob
@@ -477,7 +478,7 @@ def get_languages() -> set:
477478
def get_directory():
478479
"""Get LanguageTool directory."""
479480
try:
480-
language_tool_dir = cache['language_tool_dir']
481+
language_check_dir = cache['language_check_dir']
481482
except KeyError:
482483
def version_key(string):
483484
return [int(e) if e.isdigit() else e
@@ -492,19 +493,19 @@ def get_lt_dir(base_dir):
492493
return max(paths, key=version_key) if paths else None
493494

494495
base_dir = os.path.dirname(sys.argv[0])
495-
language_tool_dir = get_lt_dir(base_dir)
496-
if not language_tool_dir:
496+
language_check_dir = get_lt_dir(base_dir)
497+
if not language_check_dir:
497498
try:
498499
base_dir = os.path.dirname(os.path.abspath(__file__))
499500
except NameError:
500501
pass
501502
else:
502-
language_tool_dir = get_lt_dir(base_dir)
503-
if not language_tool_dir:
503+
language_check_dir = get_lt_dir(base_dir)
504+
if not language_check_dir:
504505
raise PathError('can’t find LanguageTool directory in {!r}'
505506
.format(base_dir))
506-
cache['language_tool_dir'] = language_tool_dir
507-
return language_tool_dir
507+
cache['language_check_dir'] = language_check_dir
508+
return language_check_dir
508509

509510

510511
def set_directory(path=None):
@@ -513,11 +514,11 @@ def set_directory(path=None):
513514
terminate_server()
514515
cache.clear()
515516
if path:
516-
cache['language_tool_dir'] = path
517+
cache['language_check_dir'] = path
517518
try:
518519
get_jar_info()
519520
except Error:
520-
cache['language_tool_dir'] = old_path
521+
cache['language_check_dir'] = old_path
521522
raise
522523

523524

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import re
77
import sys
88

9-
import language_tool.console_mode
9+
import language_check.console_mode
1010

1111
DEFAULT_ENCODING = 'utf-8'
1212

@@ -15,7 +15,7 @@ def parse_args():
1515
parser = argparse.ArgumentParser(
1616
description=__doc__.strip(),
1717
prog='{} -m {}'.format(os.path.basename(sys.executable),
18-
'language_tool')
18+
'language_check')
1919
)
2020
parser.add_argument('files', nargs='+',
2121
help='plain text file or "-" for stdin')
@@ -35,8 +35,8 @@ def parse_args():
3535
help='print results as XML')
3636
parser.add_argument('--version', action='version',
3737
version='LanguageTool {} ({})'
38-
.format(language_tool.get_version(),
39-
language_tool.get_build_date()),
38+
.format(language_check.get_version(),
39+
language_check.get_build_date()),
4040
help='show LanguageTool version and build date')
4141
parser.add_argument('-a', '--apply', action='store_true',
4242
help='automatically apply suggestions if available')
@@ -80,7 +80,7 @@ def main():
8080
else:
8181
encoding = args.encoding or 'utf-8'
8282

83-
lang_tool = language_tool.LanguageTool(motherTongue=args.mother_tongue)
83+
lang_tool = language_check.LanguageTool(motherTongue=args.mother_tongue)
8484
guess_language = None
8585

8686
if args.language:

0 commit comments

Comments
 (0)