Skip to content

Instantly share code, notes, and snippets.

@vincentjorgensen
Created August 3, 2021 18:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vincentjorgensen/28954598fa484d6ac9ffaafc852d30a6 to your computer and use it in GitHub Desktop.
Save vincentjorgensen/28954598fa484d6ac9ffaafc852d30a6 to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
# Adds links to Perseus Project parsed dictionary entries to a selection of Latin text
# Usage:
# 1) Save Latin in text file, ex. latin.txt
# 2) tufts-to-latin.sh latin.txt > latin.html
# 3) open latin.html in a web browser
source_file=$1
sed -e 's;\b\([a-zA-z][a-zA-Z]*\)\b;<a href="https://www.perseus.tufts.edu/hopper/morph?l=\1\&la=la" target="_blank" rel="noopener noreferrer">\1</a>;g;s/$/<br>&/g' "${source_file}"
@vincentjorgensen
Copy link
Author

Adds links to Perseus Project parsed dictionary entries to a selection of Latin text
Usage:

  1. Save Latin in text file, ex. latin.txt
  2. tufts-to-latin.sh latin.txt > latin.html
  3. open latin.html in a web browser

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment