Skip to content

Commit

Permalink
put corpus database url into CORPUS_DB_URL constant
Browse files Browse the repository at this point in the history
  • Loading branch information
bact committed Oct 20, 2018
1 parent 7a1b935 commit a7363d3
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions pythainlp/corpus/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@
from tinydb import Query, TinyDB
from tqdm import tqdm

CORPUS_DB_URL = (
"https://github.com/raw/PyThaiNLP/pythainlp-corpus/master/db.json"
)

# __all__ = ["thaipos", "thaiword","alphabet","tone","country","wordnet"]
path_db_ = get_path_db()

Expand Down Expand Up @@ -58,9 +62,7 @@ def download_(url, dst):
def download(name, force=False):
db = TinyDB(path_db_)
temp = Query()
data = requests.get(
"https://github.com/raw/PyThaiNLP/pythainlp-corpus/master/db.json"
)
data = requests.get(CORPUS_DB_URL)
data_json = data.json()
if name in list(data_json.keys()):
temp_name = data_json[name]
Expand Down

0 comments on commit a7363d3

Please sign in to comment.