Skip to content

Commit 173889f

Browse files
committed
Add downloader
1 parent 7110412 commit 173889f

File tree

3 files changed

+260
-71
lines changed

3 files changed

+260
-71
lines changed

Burrows Delta Walkthrough.ipynb

Lines changed: 252 additions & 64 deletions
Large diffs are not rendered by default.

src/faststylometry/__init__.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,10 @@
2929

3030
__version__ = "1.0.3"
3131

32-
from faststylometry.burrows_delta import calculate_burrows_delta
32+
3333
from faststylometry.corpus import Corpus
34+
from faststylometry.util import load_corpus_from_folder
3435
from faststylometry.en import tokenise_remove_pronouns_en
35-
from faststylometry.examples import download_examples
36+
from faststylometry.burrows_delta import calculate_burrows_delta
3637
from faststylometry.probability import predict_proba, calibrate, get_calibration_curve
37-
from faststylometry.util import load_corpus_from_folder
38+
from faststylometry.examples import download_examples

src/faststylometry/examples.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ def download_examples():
5151
data_path = "data"
5252
is_folder_exists = os.path.exists(data_path)
5353
if not is_folder_exists:
54-
print(f"Creating folder {data_path}.")
54+
print(f"Creating folder {data_path} in current working directory.")
5555
# Create a new directory because it does not exist
5656
os.makedirs(data_path)
5757

@@ -65,13 +65,13 @@ def download_examples():
6565
url = 'https://raw.githubusercontent.com/fastdatascience/faststylometry/main/data/train_test.zip'
6666

6767
local_file = "data/train_test.zip"
68-
print(f"Downloading {url} to {local_file}...")
68+
print(f"Downloading {url} to {local_file} in current working directory...")
6969

7070
wget.download(url, out=local_file, bar=bar_custom)
7171

72-
print(f"Downloaded {url} to {local_file}.\nExtracting...")
72+
print(f"Downloaded {url} to {local_file}.\nExtracting to {data_path}...")
7373

7474
with zipfile.ZipFile(local_file, 'r') as zip_ref:
7575
zip_ref.extractall(data_path)
7676

77-
print(f"Extracted contents of zip file to {data_path}")
77+
print(f"Extracted contents of zip file to {data_path}.")

0 commit comments

Comments
 (0)