Skip to content
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

Deprecate the support of language_tool_python #18

Closed
joshiayush opened this issue Oct 28, 2021 · 0 comments
Closed

Deprecate the support of language_tool_python #18

joshiayush opened this issue Oct 28, 2021 · 0 comments
Assignees
Labels
contributions welcome External contributions are welcome good first issue Good for newcomers

Comments

@joshiayush
Copy link
Owner

joshiayush commented Oct 28, 2021

Description

Deprecate the support of language_tool_python for correcting template syntax; we don't need it anymore.

You can remove the following code:

self._enable_language_tool = grammar_check
if self._enable_language_tool:
import language_tool_python
self._language_tool = language_tool_python.LanguageTool(
language=DEFAULT_LANG)

Also,

if self._enable_language_tool:
message = self._language_tool.correct(message)

Also, change the constructor's argument list by removing the grammar_check argument from here and subsequently update the call to Template constructor:

def __init__(
self: Template, message_template: str,
*, var_template: str, grammar_check: bool = True,
use_template: str = None) -> None:

template = Template(self._message_template,
use_template=self._use_template,
var_template=self._var_template,
grammar_check=self._grammar_check)

Also, remove the following lines of code from _install() function in inb.sh.

inb/inb.sh

Lines 62 to 89 in c0073b1

if [ $verbose -eq 0 ]; then
if [ $EUID -eq 0 ]; then
sudo apt update
sudo apt install openjdk-8-jdk openjdk-8-jre
echo "JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64" >>/etc/environment
echo "JRE_HOME=/usr/lib/jvm/java-8-openjdk-amd64/jre" >>/etc/environment
else
echo "Root privileges required to install java!" >&2
exit 1
fi
else
if [ $EUID -eq 0 ]; then
sudo apt update >/dev/null 2>&1
sudo apt install openjdk-8-jdk openjdk-8-jre >/dev/null 2>&1
echo "JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64" >>/etc/environment 2>&1
echo "JRE_HOME=/usr/lib/jvm/java-8-openjdk-amd64/jre" >>/etc/environment 2>&1
else
echo "Root privileges required to install java!" >&2
exit 1
fi
fi
source bin/activate
if [ $verbose -eq 0 ]; then
python3 -c "import language_tool_python; tool = language_tool_python.LanguageTool('en-US')"
else
python3 -c "import language_tool_python; tool = language_tool_python.LanguageTool('en-US')" >/dev/null
fi
deactivate

Make sure to update the requirements.txt as well.

@joshiayush joshiayush added the good first issue Good for newcomers label Oct 28, 2021
@joshiayush joshiayush self-assigned this Dec 7, 2021
@joshiayush joshiayush added the contributions welcome External contributions are welcome label Dec 7, 2021
joshiayush added a commit that referenced this issue Dec 21, 2021
fixes #18

Signed-off-by: Ayush Joshi <ayush854032@gmail.com>
joshiayush added a commit that referenced this issue Dec 21, 2021
fixes #18

Signed-off-by: Ayush Joshi <ayush854032@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contributions welcome External contributions are welcome good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant