Skip to content

Commit

Permalink
updated to use local lexemes.yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
jtauber committed Dec 28, 2016
1 parent d61232f commit 6cc4148
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 24 deletions.
22 changes: 9 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,7 @@ For other Greek projects of mine, see <http://jktauber.com/>.
As well as Python 3, you'll need to install the packages in `requirements.txt`
via `pip` (preferably in a virtualenv).

This requirements file now includes the MorphGNT SBLGNT but if you want the
headwords and/or glosses from the `morphological-lexicon` you'll need to clone
that repo separately.

Finally, XeTeX is required as the current output of my scripts is LaTeX with
XeTeX is required as the current output of my scripts is LaTeX with
Unicode (although I do plan to support other backends eventually). On OS X,
I use the [MacTeX distribution][mactex].

Expand Down Expand Up @@ -100,10 +96,10 @@ might look like this:
θήκη:
default: sheath

If you have the `morphological-lexicon` checked out, you can auto-generate an
initial gloss file based on John Jeffrey Dodson's public domain lexicon using
`make_glosses.py` which takes a verse range argument just like `reader.py` as
well as an `--exclude` option.
You can auto-generate an initial gloss file based on John Jeffrey Dodson's
public domain lexicon (via `lexemes.yaml` in this repo) using `make_glosses.py`
which takes a verse range argument just like `reader.py` as well as an
`--exclude` option.

If you want to extend an existing glosses file you can pass its name in using
the `--existing` option. This is useful if you've already made edits to the file
Expand All @@ -128,10 +124,10 @@ headword you want to use instead. For example:
θήκη: θήκη, ης, ἡ
Κεδρών: Κεδρών, ὁ

If you have the `morphological-lexicon` checked out, you can run
`make_headwords.py` to generate headword overrides for nouns and adjectives
based on Danker's Concise Lexicon. `make_headwords.py` takes a verse range
argument just like `reader.py` as well as an `--exclude` option.
You can run `make_headwords.py` to generate headword overrides for nouns and
adjectives based on Danker's Concise Lexicon (via the `lexemes.yaml` file).
`make_headwords.py` takes a verse range argument just like `reader.py` as well
as an `--exclude` option.

If you want to extend an existing headword file you can pass its name in using
the `--existing` option. This is useful if you've already made edits to the file
Expand Down
6 changes: 3 additions & 3 deletions make_glosses.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
help="existing glosses file")
argparser.add_argument(
"--lexicon", dest="lexemes",
default="../morphological-lexicon/lexemes.yaml",
help="path to morphological-lexicon lexemes.yaml file "
"(defaults to ../morphological-lexicon/lexemes.yaml)")
default="lexemes.yaml",
help="path to lexemes file "
"(defaults to lexemes.yaml)")

args = argparser.parse_args()

Expand Down
12 changes: 4 additions & 8 deletions make_headwords.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
"--existing", dest="headwords", help="existing headword file")
argparser.add_argument(
"--lexicon", dest="lexemes",
default="../morphological-lexicon/lexemes.yaml",
help="path to morphological-lexicon lexemes.yaml file "
"(defaults to ../morphological-lexicon/lexemes.yaml)")
default="lexemes.yaml",
help="path to lexemes file "
"(defaults to lexemes.yaml)")

args = argparser.parse_args()

Expand All @@ -39,11 +39,7 @@
if lemma not in exclusions and lemma not in headwords:
pos = entry[1]["ccat-pos"]
if pos in ["N-", "A-"]:
if "full-citation-form" in lexemes[lemma]:
headword = lexemes[lemma]["full-citation-form"]
else:
headword = lexemes[lemma]["danker-entry"]
headwords[lemma] = headword
headwords[lemma] = lexemes[lemma]["headword"]

for lemma, headword in sorted_items(headwords):
print("{}: {}".format(lemma, headword))

0 comments on commit 6cc4148

Please sign in to comment.