This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
from cltkreaders.grc import GreekTesseraeCorpusReader | |
T = GreekTesseraeCorpusReader() | |
BOOK = 16 | |
file = f"homer.iliad.part.{BOOK}.tess" | |
output = dict() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
echo "\nUpdating Homebrew...\n" | |
brew update | |
echo "\nUpgrading Homebrew...\n" | |
brew upgrade | |
echo "\nCleaning Homebrew...\n" | |
brew cleanup -s |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### Jupyter notebook for this code available at: | |
### https://github.com/isaw-ga-3024/isaw-ga-3024.github.io/blob/master/burns-patrick-diyclassics/notebooks/Omeka-XML-Parse.ipynb | |
omeka = """<?xml version="1.0"?> | |
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:dc="http://purl.org/dc/elements/1.1/"> | |
<rdf:Description rdf:about="http://dcaa.hosting.nyu.edu/cms/admin/items/show/2"> | |
<dc:title>Changing the Center of Gravity</dc:title> | |
<dc:subject>digital humanities</dc:subject> | |
<dc:creator>Terras, Melissa</dc:creator> | |
<dc:creator>Crane, Gregory</dc:creator> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Zen Pythonis | |
a T. Peters imprimis Anglice scriptum | |
redditumque Latine a Patricio Ios. Burns: | |
– Formosum deformi praefertur. | |
– Directum obliquo praefertur. | |
– Simplex multiplici praefertur. | |
– Multiplex contorto praefertur. | |
– Planum implicato praefertur. | |
– Rarum denso praefertur. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
```python | |
from pycollatinus import Lemmatiseur | |
import pprint | |
tagger = Lemmatiseur() | |
``` | |
```python | |
lemmas = tagger.lemmatise_multiple('ne') | |
lemmas_set = sorted(set([lemma['lemma'] for lemma in lemmas[0]])) | |
print(lemmas_set) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Written by diyclassics | |
* | |
* Looks for text in a Google Doc on open in the form "last updated 1/1/2001" and updates | |
* with the current date; also adds a menu item for manual update. | |
*/ | |
function onOpen() { | |
var ui = DocumentApp.getUi(); | |
// Or FormApp or SpreadsheetApp. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function getShortDef(input) { | |
var array = []; | |
var url = "http://www.perseus.tufts.edu/hopper/morph?l=" + input; | |
var page = UrlFetchApp.fetch(url); | |
var doc = Xml.parse(page, true); | |
var bodyHtml = doc.html.body.toXmlString(); | |
doc = XmlService.parse(bodyHtml); | |
var root = doc.getRootElement(); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from cltk.corpus.latin import latinlibrary | |
from cltk.tokenize.word import WordTokenizer | |
tokenizer = WordTokenizer('latin') | |
ll_raw = latinlibrary.raw() | |
print(ll_raw[:500]) | |
ll_words = latinlibrary.words() | |
print(ll_words[:100]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import re | |
GREEK = '\u0300-\u03FF' | |
GREEK_EXT = '\u1F00-\u1FFF' | |
# Cicero Att 1.4 | |
# http://www.perseus.tufts.edu/hopper/text?doc=Perseus%3Atext%3A1999.02.0008%3Abook%3D1%3Aletter%3D1%3Asection%3D4 | |
text = """ | |
sane sum perturbatus cum ipsius Satyri familiaritate tum Domiti, in quo uno maxime ambitio nostra nititur. demonstravi haec Caecilio simul et illud ostendi, si ipse unus cum illo uno contenderet, me ei satis facturum fuisse; nunc in causa universorum creditorum, hominum praesertim amplissimorum, qui sine eo quem Caecilius suo nomine perhiberet facile causam communem sustinerent, aequum esse eum et officio meo consulere et tempori. durius accipere hoc mihi visus est quam vellem et quam homines belli solent, et postea prorsus ab instituta nostra paucorum dierum consuetudine longe refugit. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
import urllib.request | |
def get_pleiades_json(pleiades_id): | |
# pleiades_id: STR | |
pleiades_url = "https://raw.githubusercontent.com/ryanfb/pleiades-geojson/gh-pages/geojson/%s.geojson" % pleiades_id | |
try: | |
with urllib.request.urlopen(pleiades_url) as url: | |
pleiades_geojson = json.loads(url.read().decode()) | |
return pleiades_geojson |
NewerOlder