#! /usr/bin/python3
import sys, re
import html_gen as h
from process_funcs import bash
import html_report_funcs as hr
last_edit = "Last edited on 2026-03-03 01:24:18 by stolfi"
def main():
global last_edit
title = "[096] Glossary for analysys of Herbal A vs. B"
st = h.new_doc(title, "#eeffdd")
h.section(st, 2, "Transcription files")
h.parags(st, """All statistics on this paper are based on a digital transcription of the VMS in the EVA transcription alphabet which is partly Rene Zandbergen's recent IVT file and partly a new transcription of my own. In this specific file, all #-comments and inline comments have been removed, the braces '{...}' indicating ligatures have been omitted, all "weirdo" character codes '&NNN;' have been mapped to '?', and all EVA codes have been mapped to loowecase. Paragraphs are indicated with a '<%>' prefix on the head lines and '<$>' suffix on the tail lines. Rene's IVTFF 'location codes' are not used; instead, on each parag or title line, one of the characters '«', '=', or '»' is used as prefix (resp. suffix) to indicate indentation relative to the left (resp. right) rail line of the enclosing text block, respectively. See the sample below:""")
h.append_preformatted(st, """
<%>»?.odar.?.shol.cphoy.oydar.sh??s.cfhoaiin.shodar,y=
=yshey.shody.o,kchoy.otchol.chocthy.oschy.dain.chor.kos=
=daiin.shos.cfhol.shody«<$>
»dain.or.teody=
<%>»?.y,dain.cphesaiin.ol,s.cphey.y,tain.shoshy.cphodal,es=
=ok,sho.kshoy.o,tairin.otchl.okan.shodain.sckhhy.daiin=
""", ind = 4, centered = False)
h.parags(st, """Note that lines 7-9 are a complete parag; lines 7 and 8 span the full width of the text block,
the tail line 9 is left-justified but ends before the right rail, and line 10 is a right-justified title.
For this note we apply a few additions cleanup actions on this file:""")
h.begin_enum(st, "ul")
h.enum_item(st, "The rare characters [bjuvxy] were mapped to '?' (\"invalid\").")
h.enum_item(st, "The 'g' in word-final position was replaced by 'm'")
h.enum_item(st, "The combination 'ih' was replaced by 'ch'.")
h.enum_item(st, "The 'i' at the start of platform gallows like 'ith' was replaced by 'c'.")
h.enum_item(st, "The combination 'hh' in platform gallows like 'cthh' was replaced by 'he'.")
h.end_enum(st, "ul")
h.parags(st, """After this cleanup, the transcribed Voynichese text consists entirely of the EVA letters [ac-fhik-ty], the invalid glyph marker '?', and the separators '-' (line break), '.' (definite word space), and ',' (uncertain word space).""")
h.section(st, 2, "Sections and text types")
h.parags(st, """For this note, the transcription file above was split into separate files "{sec}-{txtype}.ivt" in this forler for each section {sec} ("hea", "heb","zod", etc.) and each text type {txtype}. The assignment of VMS lines to sections is defined by this table. In this note we consider only the two parts of the Herbal section traditionally assigned to language A ("hea", 1203 lines) and language B ("heb", 384 lines).
The text type of each line of the transcription file is defined by another table. The possible types are "parags" (text in paragraph-like blocks), "trings" (text rings in diagrams), "radios" (radial lines in diagrams), "titles" (isolated multiword lines not part of parags), "glyphs" (isolated single cracaters not inside other text), and "labels" (short texts associated with figure details). In this note we use only "parags" type text.""")
h.section(st, 2, "Words, tokens, and WFDs")
h.parags(st, """In this this article, we define a word (aka "word type") as a distinct string of EVA codes in [a-z?]. A token is an occurrence of a word in a specific position in a specific line of the transcription, delimied by word space characters [-,.]. Thus, for example, the text line chod.daiin,chody.daiin-chod contains three words (chod, chody, and daiin) but five tokens.
The count {Ct(W)} of a word {W} in a section is the number of times it occurs as a token in that section. Its frequency of freq {Fr(W)} is its count {Ct(W)} divided by the total numeber of tokens in the secton. The function {Fr} is the word frequency distribution (WFD) of that section section. The set of all words with nonzero frequency are the lexicon of the section.
For this analysis we actually let {Ct(W)} be a fractional count, which is the expected count of W if each comma is replaced by a period or omitted, independently and with equal probability. Thus, for example, in the line ar,ol-ody,dy,chy.daiin the word daiin has count 1, the words ar, ol, arol, ody>, and chy have count of 0.5 each, and odydy, dy, dychy, and odydychy have counts 0.25 each. The total number of tokens in that text is then defined as the sum of these fractional counts, namely 4.5. Which is the number of dots and dashes in the text, plus half the number of commas, plus 1.""")
h.output_doc(st, sys.stdout, 99, last_edit)
return 0
# ----------------------------------------------------------------------
main()