Computational Methods for Homeric Formulae
Project description
Formulaic Mechanics
Created by Annie K. Lamar, and submitted as part of her dissertation project, "Formulaic Mechanics" (Stanford University, 2024)
Introduction
The creation of an open-source codebase and the many datasets produced in the above chapters represents a significant component of this project. Some of the functions that this codebase provides are truly novel; they are, to my knowledge, the first computational attempt at a given problem. All the computational work related to mutual expectancy falls into this category. Other functions are novel in their accessibility.
Notably, the TLG prohibits the copying or downloading of the text results from their database. With this codebase, you can perform almost all the same functions that the TLG provides (although only for Homer, and without lemmatization), and you are free to download and use the results in any manner you wish. Notably, the TLG does not provide a way to filter results by metrical pattern or degree of formulaic language—those abilities are unique to this project.
I want this code to be downloaded and used by any researcher for whom it is helpful. I also strove to make this codebase accessible to researchers with little or no programming experience. First, all the datasets are available as .csv files that can be loaded into an external platform like Excel; there is no need to touch the code at all to use much of this data. Second, I have provided both an interactive Jupyter notebook with many code snippets already written where a Classicist with minimal effort can simply switch out line numbers or text names to obtain results. Third, the codebase is heavily commented and accompanied by a technical documentation website. Beginning programmers can easily work with the code.
Download & Installation
To download this package directly from GitHub:
git clone https://github.com/AnnieKLamar/formulaic_mechanics
You can also install this package using pip:
pip install formulaic_mechanics
Dependencies & Requirements
The following non-native Python packages are required:
pandas
scipy
statsmodels
lexical-diversity
Quickstart
Almost all the code in this package is built to work with, on, or within a Corpus object. The Corpus
class is
defined in the file corpus.py
. To instantiate a Corpus
object, you can simply run this line of code:
Corpus = Corpus()
Instantiating a Corpus object should take less than a minute if you downloaded all the data files (in the /data folder) along with the code. In the case that the data is already available, you will be notified as each dataset is loaded. You will see the following appear in your console or IDE:
Bigram frequencies loaded.
Bigram expectancies loaded.
…
Proper noun statistics loaded.
Repeated line sets loaded.
If you did not download the data folder, Corpus
object instantiation will also go through the process of
recreating most of the datasets described below. This could take hours or days depending on the computational power
of your machine. Each dataset creation process will also print progress update statements. By default, the data
folder is included in the pip installation process.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for formulaic_mechanics-0.0.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | b513e7c0e4daf7dbae41af24603a9769f5ff15a2fceea4052f4b9192289d9024 |
|
MD5 | 32e8f38a6704d61efd97e669b9e7a4ea |
|
BLAKE2b-256 | 41d165ac4a247f52bb453b04518b6429866d4976590a3250a7c4ee28970bf6ed |
Hashes for formulaic_mechanics-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | be99dab809bdd5c1cf4af5e8a1c499fab95ee6c040f146746b1a57b674da8d3a |
|
MD5 | bf23e449503af5dce48e359e12c435f1 |
|
BLAKE2b-256 | 61f64f62d0c5922c00a06e2ab7841a45e4698d16504abe6d36d7579f405493dd |