Skip to content
This repository was archived by the owner on May 27, 2025. It is now read-only.

Commit 61aff40

Browse files
Updated wiki sample article download script: changed flag from --only-summary to --short-summary (#66)
1 parent 54e0e49 commit 61aff40

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

notebooks/get-wiki-articles.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ def main():
2828
default="testdata",
2929
)
3030
parser.add_argument(
31-
"--only-summary",
32-
help="Retrieve only summary article content.",
31+
"--short-summary",
32+
help="Retrieve short summary article content.",
3333
action="store_true",
3434
)
3535
parser.add_argument(
@@ -46,9 +46,10 @@ def main():
4646
title = wikipedia.page(state).title.lower().replace(" ", "_")
4747
content = (
4848
wikipedia.page(state).summary
49-
if args.only_summary
49+
if args.short_summary
5050
else wikipedia.page(state).content
5151
)
52+
content = content.strip()
5253
filename = os.path.join(args.directory, f"{title}_wiki_article.txt")
5354
with open(filename, "w", encoding="utf-8") as f:
5455
f.write(content)

0 commit comments

Comments
 (0)