diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..0e40fe8 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,3 @@ + +# Default ignored files +/workspace.xml \ No newline at end of file diff --git a/.idea/Orrick-Flashcards.iml b/.idea/Orrick-Flashcards.iml new file mode 100644 index 0000000..1f5612b --- /dev/null +++ b/.idea/Orrick-Flashcards.iml @@ -0,0 +1,11 @@ + + + + + + + + + + \ No newline at end of file diff --git a/.idea/inspectionProfiles/profiles_settings.xml b/.idea/inspectionProfiles/profiles_settings.xml new file mode 100644 index 0000000..105ce2d --- /dev/null +++ b/.idea/inspectionProfiles/profiles_settings.xml @@ -0,0 +1,6 @@ + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..def5dd1 --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..43e5ebe --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..129a377 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/Flashcard Generator/question_filter.py b/Flashcard Generator/question_filter.py new file mode 100644 index 0000000..97b8d4d --- /dev/null +++ b/Flashcard Generator/question_filter.py @@ -0,0 +1,21 @@ +import language_check +import os +# import getpass + +def question_filter(questions_ls): + # Need to implement this part to do a interactive feature that takes client's password: + ''' + # sudo_password = input('Input password for a sudo command: ') + # os.system('if which jenv > /dev/null; then eval "$(jenv init -)"; fi') + # need to import getpass for the following line + # sudo_password = getpass.getpass() + # command = 'sudo jenv global 1.8.0.242' + # os.system('echo %s|sudo -S %s' % (sudo_password, command)) + ''' + tool = language_check.LanguageTool('en-US') + for q in questions_ls: + matches = tool.check(q) + if matches != []: + questions_ls.remove(q) + + return questions_ls diff --git a/grammar_checker/.gitignore b/backup_correcter/.gitignore similarity index 100% rename from grammar_checker/.gitignore rename to backup_correcter/.gitignore diff --git a/grammar_checker/.travis.yml b/backup_correcter/.travis.yml similarity index 100% rename from grammar_checker/.travis.yml rename to backup_correcter/.travis.yml diff --git a/grammar_checker/COPYING b/backup_correcter/COPYING similarity index 100% rename from grammar_checker/COPYING rename to backup_correcter/COPYING diff --git a/grammar_checker/COPYING.LESSER b/backup_correcter/COPYING.LESSER similarity index 100% rename from grammar_checker/COPYING.LESSER rename to backup_correcter/COPYING.LESSER diff --git a/grammar_checker/Dockerfile b/backup_correcter/Dockerfile similarity index 100% rename from grammar_checker/Dockerfile rename to backup_correcter/Dockerfile diff --git a/grammar_checker/MANIFEST.in b/backup_correcter/MANIFEST.in similarity index 100% rename from grammar_checker/MANIFEST.in rename to backup_correcter/MANIFEST.in diff --git a/grammar_checker/Makefile b/backup_correcter/Makefile similarity index 100% rename from grammar_checker/Makefile rename to backup_correcter/Makefile diff --git a/backup_correcter/demo.py b/backup_correcter/demo.py new file mode 100644 index 0000000..b1f2728 --- /dev/null +++ b/backup_correcter/demo.py @@ -0,0 +1,46 @@ +import language_check +import os +import getpass + + +def question_filter(questions_ls): + + # sudo_password = input('Input password for a sudo command: ') + + #os.system('if which jenv > /dev/null; then eval "$(jenv init -)"; fi') + #sudo_password = getpass.getpass() + #command = 'sudo jenv global 1.8.0.242' + #os.system('echo %s|sudo -S %s' % (sudo_password, command)) + + tool = language_check.LanguageTool('en-US') + for q in questions_ls: + matches = tool.check(q) + if matches != []: + questions_ls.remove(q) + + return questions_ls + +def main(): + + qls = ['What is H20?', + 'Can this Java-program be written better?', + 'Who teaches Java at teamtreehouse?', + 'Which Countries share a border with Switzerland?', + 'What is our group name?', + 'Who was the 3rd president of the United States?', + 'Which law school?', + 'Which law school do you attend?'] + + q1 = ['What could not support class certification even if they were implemented?', + 'Moreover, Plaintiffs injury theories could not support class certification even if they were implemented.', + 'What was thus appropriately denied?', + 'Class certification was thus appropriately denied.', + 'Who has provided Plaintiffs ample opportunity to establish their case?', + 'Since inheriting this and related cases in 2012 (when Judge James Ware retired), Judge Gonzalez Rogers has been impartial, patient and provided Plaintiffs ample opportunity to establish their case.', + 'What are suspect?', "Plaintiffs' motivations in even raising the issue are suspect.", 'What did Rail Freight F.3d at?', 'Rail Freight, 725 F.3d at 253.', 'What 459?'] + + print(question_filter(q1)) + print(question_filter(qls)) + +if __name__ == '__main__': + main() \ No newline at end of file diff --git a/grammar_checker/download_lt.py b/backup_correcter/download_lt.py similarity index 100% rename from grammar_checker/download_lt.py rename to backup_correcter/download_lt.py diff --git a/grammar_checker/example.txt b/backup_correcter/example.txt similarity index 100% rename from grammar_checker/example.txt rename to backup_correcter/example.txt diff --git a/grammar_checker/language-check b/backup_correcter/language-check similarity index 100% rename from grammar_checker/language-check rename to backup_correcter/language-check diff --git a/grammar_checker/language_check/__init__.py b/backup_correcter/language_check/__init__.py similarity index 100% rename from grammar_checker/language_check/__init__.py rename to backup_correcter/language_check/__init__.py diff --git a/grammar_checker/language_check/__main__.py b/backup_correcter/language_check/__main__.py similarity index 100% rename from grammar_checker/language_check/__main__.py rename to backup_correcter/language_check/__main__.py diff --git a/grammar_checker/language_check/backports/__init__.py b/backup_correcter/language_check/backports/__init__.py similarity index 100% rename from grammar_checker/language_check/backports/__init__.py rename to backup_correcter/language_check/backports/__init__.py diff --git a/grammar_checker/language_check/backports/subprocess.py b/backup_correcter/language_check/backports/subprocess.py similarity index 100% rename from grammar_checker/language_check/backports/subprocess.py rename to backup_correcter/language_check/backports/subprocess.py diff --git a/grammar_checker/language_check/console_mode.py b/backup_correcter/language_check/console_mode.py similarity index 100% rename from grammar_checker/language_check/console_mode.py rename to backup_correcter/language_check/console_mode.py diff --git a/grammar_checker/language_check/main.py b/backup_correcter/language_check/main.py similarity index 100% rename from grammar_checker/language_check/main.py rename to backup_correcter/language_check/main.py diff --git a/grammar_checker/language_check/q_ls.txt b/backup_correcter/language_check/q_ls.txt similarity index 100% rename from grammar_checker/language_check/q_ls.txt rename to backup_correcter/language_check/q_ls.txt diff --git a/grammar_checker/language_check/which.py b/backup_correcter/language_check/which.py similarity index 100% rename from grammar_checker/language_check/which.py rename to backup_correcter/language_check/which.py diff --git a/grammar_checker/run_doctest.py b/backup_correcter/run_doctest.py similarity index 100% rename from grammar_checker/run_doctest.py rename to backup_correcter/run_doctest.py diff --git a/grammar_checker/setup.cfg b/backup_correcter/setup.cfg similarity index 100% rename from grammar_checker/setup.cfg rename to backup_correcter/setup.cfg diff --git a/grammar_checker/setup.py b/backup_correcter/setup.py similarity index 100% rename from grammar_checker/setup.py rename to backup_correcter/setup.py diff --git a/grammar_checker/test.bash b/backup_correcter/test.bash similarity index 100% rename from grammar_checker/test.bash rename to backup_correcter/test.bash diff --git a/grammar_checker/test.py b/backup_correcter/test.py similarity index 100% rename from grammar_checker/test.py rename to backup_correcter/test.py diff --git a/grammar_checker/test_remote.bash b/backup_correcter/test_remote.bash similarity index 100% rename from grammar_checker/test_remote.bash rename to backup_correcter/test_remote.bash diff --git a/grammar_checker/README.rst b/grammar_checker/README.rst deleted file mode 100644 index 2fb3933..0000000 --- a/grammar_checker/README.rst +++ /dev/null @@ -1,102 +0,0 @@ -language-check -============== - -Python wrapper for LanguageTool. - -.. image:: https://travis-ci.org/myint/language-check.svg?branch=master - :target: https://travis-ci.org/myint/language-check - :alt: Build status - -This is a fork of -https://bitbucket.org/spirit/language_tool that produces more easily parsable -results from the command-line. - -Example usage -------------- - -From the interpreter: - ->>> import language_check ->>> tool = language_check.LanguageTool('en-US') ->>> text = u'A sentence with a error in the Hitchhiker’s Guide tot he Galaxy' ->>> matches = tool.check(text) ->>> len(matches) -2 - -Check out some ``Match`` object attributes: - ->>> matches[0].fromy, matches[0].fromx -(0, 16) ->>> matches[0].ruleId, matches[0].replacements -('EN_A_VS_AN', ['an']) ->>> matches[1].fromy, matches[1].fromx -(0, 50) ->>> matches[1].ruleId, matches[1].replacements -('TOT_HE', ['to the']) - -Print a ``Match`` object: - ->>> print(matches[1]) -Line 1, column 51, Rule ID: TOT_HE[1] -Message: Did you mean 'to the'? -Suggestion: to the -... - -Automatically apply suggestions to the text: - ->>> language_check.correct(text, matches) -'A sentence with an error in the Hitchhiker’s Guide to the Galaxy' - -From the command line:: - - $ echo 'This are bad.' > example.txt - - $ language-check example.txt - example.txt:1:1: THIS_NNS[3]: Did you mean 'these'? - - -Installation ------------- - -To install via pip:: - - $ pip install --upgrade language-check - -If you are using Python 2, you'll need to install 3to2 beforehand:: - - $ pip install --upgrade 3to2 - -To overwrite the host part of URL that is used to download LanguageTool-{version}.zip:: - - - SET LANGUAGE_CHECK_DOWNLOAD_HOST = [alternate URL] - - -Prerequisites -------------- - -- `Python 3.3+ `_ (or 2.7) -- `lib3to2 `_ - (if installing for Python 2) -- `LanguageTool `_ (Java 6.0+) - - -The installation process should take care of downloading LanguageTool (it may -take a few minutes). Otherwise, you can manually download -`LanguageTool-stable.zip -`_ and unzip it -into where the ``language_check`` package resides. - -Vim plugin ----------- - -To use language-check in Vim, install Syntastic_ and use the following -settings: - -.. code-block:: vim - - let g:syntastic_text_checkers = ['language_check'] - let g:syntastic_text_language_check_args = '--language=en-US' - -Customize your language as appropriate. - -.. _Syntastic: https://github.com/scrooloose/syntastic