Skip to content

Commit

Permalink
Lowercase the "word" variable before looking up in EXPECTANCY.
Browse files Browse the repository at this point in the history
The tei2csv "word" column is always lowercased as a side effect of the
hexameter module's analysis. The "word" lookup in tei2html did not
similarly lowercase the text of the word, so clicking on a word that was
not already all lowercase produced to result.

It may be possible to instead have tei2csv retain letter case in the
"word" column, but that will require an audit of source texts to see
that the same word is not used with different cases in different places.

Closes #84.
  • Loading branch information
David Fifield committed Oct 30, 2023
1 parent 526941f commit 6936e07
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/tei2html
Original file line number Diff line number Diff line change
Expand Up @@ -928,7 +928,11 @@ function info(target) {
["book_n", bookno],
["line_n", lineno],
["word_n", wordno],
["word", target.textContent],
// Lowercase the literal word from the text, to match what
// hexameter.analyze_line_metrical does internally and what is stored in
// tei2csv output.
// https://github.com/sasansom/sedes/blob/526941f65bf88efb82db7d3bfbfe632e4f0d40ff/src/hexameter/scan.py#L378
["word", target.textContent.toLowerCase()],
["lemma", target.getAttribute("data-lemma")],
["sedes", target.getAttribute("data-sedes")],
["metrical_shape", target.getAttribute("data-shape")],
Expand Down

0 comments on commit 6936e07

Please sign in to comment.