Skip to content

Commit a7363d3

Browse files
committed
put corpus database url into CORPUS_DB_URL constant
1 parent 7a1b935 commit a7363d3

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

pythainlp/corpus/__init__.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@
1010
from tinydb import Query, TinyDB
1111
from tqdm import tqdm
1212

13+
CORPUS_DB_URL = (
14+
"https://raw.githubusercontent.com/PyThaiNLP/pythainlp-corpus/master/db.json"
15+
)
16+
1317
# __all__ = ["thaipos", "thaiword","alphabet","tone","country","wordnet"]
1418
path_db_ = get_path_db()
1519

@@ -58,9 +62,7 @@ def download_(url, dst):
5862
def download(name, force=False):
5963
db = TinyDB(path_db_)
6064
temp = Query()
61-
data = requests.get(
62-
"https://raw.githubusercontent.com/PyThaiNLP/pythainlp-corpus/master/db.json"
63-
)
65+
data = requests.get(CORPUS_DB_URL)
6466
data_json = data.json()
6567
if name in list(data_json.keys()):
6668
temp_name = data_json[name]

0 commit comments

Comments
 (0)