Skip to content

Commit

Permalink
Merge branch 'master' of github.com:thePortus/dhelp
Browse files Browse the repository at this point in the history
  • Loading branch information
thePortus committed Mar 9, 2018
2 parents 63550bb + 7546443 commit b9150f1
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ Requires [Python 3.x](https://python.org)
# Table of Contents

* [Installation](#installation)
* [Quickstart Guide](#quickstart-guide)
* [Language Setup](#language-setup)
* [Web Module](#web-module)
* [WebPage](#webpage)
* [File Module](#file-module)
Expand Down Expand Up @@ -75,14 +75,14 @@ easy_install setup.py

```

## Greek & Latin Users
# Language Setup

If you want to work with Greek and Latin, you need to install cltk via pip...
The first time you use a language-specific text object, you need to run its .setup() method

```sh
from dhelp import EnglishText

# you may need admin privileges
pip install cltk
EnglishText('').setup()

```

Expand Down
4 changes: 4 additions & 0 deletions dhelp/text/_bases_mixins.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/usr/bin/python

import pip
import re
from collections import UserString

Expand Down Expand Up @@ -421,6 +422,9 @@ def setup(self):
Example:
>>> LatinText('').setup()
"""
# first, download the cltk module from pip
pip.main(['install', 'cltk'])
# import cltk inline as global import errors for non-cltk users
from cltk.corpus.utils.importer import CorpusImporter
corpus_importer = CorpusImporter(self.options['language'])
# loop through and attempt to download, skip any errors
Expand Down

0 comments on commit b9150f1

Please sign in to comment.