Skip to content

Commit

Permalink
stash
Browse files Browse the repository at this point in the history
  • Loading branch information
Khemarato Bhikkhu committed Jun 12, 2024
1 parent 999e4ab commit 36051b0
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 13 deletions.
2 changes: 2 additions & 0 deletions _content/monographs/debt_graeber-david.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ title: "Debt: The First 5000 Years"
authors:
- graeber-david
course: economics
external_url: "https://archive.org/details/DebtTheFirst5000Years/page/n2/mode/1up"
alternative_link: "https://warwick.ac.uk/fac/arts/english/currentstudents/undergraduate/modules/fulllist/special/statesofdamage/syllabus201516/graeber-debt_the_first_5000_years.pdf"
status: featured
olid: OL27883779M
tags:
Expand Down
1 change: 1 addition & 0 deletions _content/monographs/phoenix-complex_marder-michael.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ drive_links:
- "https://drive.google.com/file/d/1ytSlb0gASNrU3vyoktnkEH7BbYbeerp8/view?usp=drivesdk"
tags:
- mythology
- natural
- time
year: 2023
olid: OL42751992M
Expand Down
2 changes: 1 addition & 1 deletion _tags/books.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: "The Book"
status: unpublished
parents: [things, media]
parents: [media]
---

The history of bound pages.
2 changes: 1 addition & 1 deletion _tags/media.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: "Media Studies"
hashtag: "mediaStudies"
status: unpublished
parents: [communication]
parents: [communication, things]
---

The study of how different forms of communication afford different communication styles and thus alter how people think.
8 changes: 3 additions & 5 deletions scripts/android_import_sutta.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@
from gdrive import upload_to_google_drive, get_gfolders_for_course, get_known_courses, create_drive_shortcut, DRIVE_LINK
from archivedotorg import save_url_to_archiveorg
from pdfutils import readpdf, get_page_count
# Bypassing for now due to SciPy crash
# from tag_predictor import TagPredictor
from tag_predictor import TagPredictor

yaml_list_prefix = '\n - '
NONSC_TRANSLATORS = [{
Expand Down Expand Up @@ -229,7 +228,7 @@ def process_pdf(pdf_file):
print(f"Processing {pdf_file}...")
pdf_file = Path(pdf_file)
pages = get_page_count(pdf_file)
# pdf_text = readpdf(pdf_file)
pdf_text = readpdf(pdf_file)
guess = guess_id_from_filename(pdf_file.stem)
while True:
sutta = input_with_prefill("Sutta ID? ", guess)
Expand All @@ -244,8 +243,7 @@ def process_pdf(pdf_file):
if not prompt("File already exists! Continue anyway?"):
return
blurb = get_blurb_for_suttaid(slug) or ''
# course = TagPredictor.load().predict([blurb + ' ' + pdf_text])[0]
course = ''
course = TagPredictor.load().predict([blurb + ' ' + pdf_text])[0]
parsed = sutta_id_re.match(slug)
book = parsed.group(1)
nums = [parsed.group(2), parsed.group(3)]
Expand Down
10 changes: 4 additions & 6 deletions scripts/gdrive.py
Original file line number Diff line number Diff line change
Expand Up @@ -571,11 +571,9 @@ def _yt_thumbnail(snippet):
return snippet['thumbnails']['default']['url']

def make_ytvideo_summary_html(vid):
# temporarily bypass caching during SciPy bug
# from tag_predictor import YOUTUBE_DATA_FOLDER
# cachef = YOUTUBE_DATA_FOLDER.joinpath(f"{vid}.json")
# if cachef.exists():
if False:
from tag_predictor import YOUTUBE_DATA_FOLDER
cachef = YOUTUBE_DATA_FOLDER.joinpath(f"{vid}.json")
if cachef.exists():
snippet = json.loads(cachef.read_text())
transcript = snippet.get('transcript',[])
else:
Expand All @@ -586,7 +584,7 @@ def make_ytvideo_summary_html(vid):
snippet['transcript'] = transcript
except:
pass
# cachef.write_text(json.dumps(snippet))
cachef.write_text(json.dumps(snippet))
return _make_ytvideo_summary_html(vid, snippet, transcript)

def _make_ytvideo_summary_html(vid, snippet, transcript):
Expand Down

0 comments on commit 36051b0

Please sign in to comment.