Package: qporcupine
QPorcupineA library from Quill.org to provide feedback on common grammar errors. Errors detected include spelling errors, fragments, and subject-verb agreement errors.Note:This library is currently unstable; please be aware
that updates could include breaking changes.UsageAs a module:fromqporcupineimportcheckfeedback=check('Until she leapt into the air and kissed him.')print(feedback.human_readable)Expected output:This looks like a subordinating conjunction fragment.
Try removing the subordinating conjunction or adding a main clause.Installation1. Install languagetoolqporcupine relies on LanguageTool to function. LanguageTool is an open-source
grammar and spell-checker written in Java. In order to maximize performance, we
will run a languagetool server that qporcupine will be able to connect to.Change to the opt directory. If you don't have one, create one with$ sudo mkdir /opt.$cd/optDownload and unzip languagetool.$sudocurl-O"https://languagetool.org/download/LanguageTool-4.1.zip"$sudounzipLanguageTool-4.1.zip
$sudormLanguageTool-4.1.zipAdd the follwing lines to your .bash_profile or system equivalent. Do not
include a trailing slash for the LT_URI.aliasltserver='nohup java -cp /opt/LanguageTool-4.1/languagetool-server.jar org.languagetool.server.HTTPServer --port 8081 </dev/null >/dev/null 2>&1 &'exportLT_URI=http://localhost:8081Start the server$ltserverLanguageTool is now running on port 8081. To test that it works try hittinghttp://localhost:8081/v2/check?language=en-US&text=my+textin your browser.2. Download the AllenNLP Constituency Parserqporcupine uses theAllenNLPlibrary, a suite of open-source
natural-language processing tools developed by the Allen Institute for Artificial
Intelligence. Specifically, qporcupine uses theconstituency parsemodel from AllenNLP.We store the AllenNLP model in/var/lib/allennlp. To configure this folder and download the model for use, run:$sudomkdir/var/lib/allennlp
$cd/var/lib/allennlp&&{sudocurl-Ohttps://s3-us-west-2.amazonaws.com/allennlp/models/elmo-constituency-parser-2018.03.14.tar.gz;cd-;}3. Install Pattern for Python 3One of qporcupine's dependencies is a development branch of thePattern.enlibrary, which is not available through PyPi. Consequently, qporcupine must be directly installed from its Github repo. This can be done with the command$pipinstallgit+git://github.com/clips/pattern.git@53245196139c6ef26dc9c34873dda8a16f236d23#egg=PatternIn some cases, there may be conflicts between this installation of the Pattern library and existing installations of Pattern on your local machine. If so, we suggest uninstalling Pattern and attempting to install qporcupine again. You may also need the--no-cache-dirflag forpip install.4. Install qporcupinepipinstallqporcupine5. Configure Spacy Language Modelqporcupine uses theen_core_web_lgSpacy model by default. To configure this model, you may have to download theen_core_web_lgmodel from Spacy by running:python-mspacydownloaden_core_web_lgIf you wish to download and configure another model, do so withpython-mspacydownload<SPACYMODELNAME>and setexportQUILL_SPACY_MODEL=<SPACY_MODEL_NAME>TestsQPorcupine usesnoseto run tests. To run tests from the root directory of qporcupine:$pipinstallnose
$nosetestsVersion SupportPlease note that QPorcupine does not currently support Python 3.7. We suggest using Python 3.6.x .