Skip to content

Instantly share code, notes, and snippets.

@fhardison
fhardison / get_paradigm.py
Last active March 12, 2020 13:36
Using py-sblgnt we can create a tool to get a all the forms for a specified lemma that occur in the sblgnt for a particular paradigm set (PAI, AAS, etc). For example running `python get_paradigm.py λύω PAI` will return all Present Active Indicative forms for λύω. Running `python get_paradigm.py λύω \*` will get you all the forms of λύω.
from collections import Counter, defaultdict
from pysblgnt import morphgnt_rows
from greek_normalisation.utils import nfc
import sys
def get_data():
data = defaultdict(dict)
books = range(1,28)
for i in books:
for row in morphgnt_rows(i):
@fhardison
fhardison / ref_tools.py
Created December 11, 2019 00:09
A helper function for @jtauber 's [vocabulary-tools](https://github.com/jtauber/vocabulary-tools)
BOOKS = [
'MAT',
'MRK',
'LUK',
'JHN',
'ACT',
'ROM',
'1CO',
'2CO',
'GAL',