lukehollis / iip-word-lists

Python utility for creating word lists from epidoc files
1 stars 1 forks source link

Abbreviations (<expan>) #2

Open emylonas opened 3 years ago

emylonas commented 3 years ago

Abbreviations are surrounded by the <expan> element. The whole <expan> element should be surrounded by a <w> element and completely copied over (deep copy, so all elements and attributes that are inside it also get copied. Whatever white space is inside an <expan> is insignificant - only other elements are allowed within <expan>. Example:

 <p>Είρατος<lb/>
               <expan>
                  <abbr>Σελ</abbr><ex>ε</ex><abbr>υκ</abbr><ex>ίδος</ex>
               </expan>
</p>

Should be copied as:

               <w><expan> <abbr>Σελ</abbr><ex>ε</ex><abbr>υκ</abbr><ex>ίδος</ex></expan></w>
 </p>

Inscriptions with abbreviations for testing: akld0003

zeichman commented 3 years ago

In some instances, adjacent words that both have the <expan> attribute are mashed into a single word until there is a line break or a word lacking the attribute. Looking at jeru0497:

The text <expan><abbr>Imp</abbr><ex>eratori</ex></expan> <expan><abbr>Caes</abbr><ex>ari</ex></expan></supplied> is currently being rendered as a single word: <w><expan><abbr>Imp</abbr><ex>eratori</ex></expan><expan><abbr>Caes</abbr><ex>ari</ex></expan></supplied></w>.

It should instead be two words: <w><expan><abbr>Imp</abbr><ex>eratori</ex></expan></w> <w><expan><abbr>Caes</abbr><ex>ari</ex></expan></supplied></w>.

See also this same phenomenon in caes0106: <expan><abbr>Imp</abbr><ex>eratori</ex></expan> <expan><abbr>Caes</abbr><ex>ari</ex></expan> <expan><abbr>C</abbr><ex>aio</ex></expan> should be three words, but is currently being rendered as a single word.

emylonas commented 3 years ago

Technically, the code should be able to pick that up, as any

... is a word, but we could add a space in between. best, --elli On Fri, Mar 26, 2021 at 12:36 PM Christopher B. Zeichmann < ***@***.***> wrote: > In some instances, adjacent words that both have the attribute > are mashed into a single word until there is a line break or a word lacking > the attribute. Looking at jeru0497: > > Caesari```` is currently being rendered as a single word: ````ImperatoriCaesari````. > > It should instead be two words: ````Imperatori Caesari````. > > See also this same phenomenon in caes0106: ````Imperatori Caesari Caio```` should be three words, but is currently being rendered as a single word. > > — > You are receiving this because you authored the thread. > Reply to this email directly, view it on GitHub > , > or unsubscribe > > . >
zeichman commented 3 years ago

Forgive me if I'm misunderstanding, Elli, but it looks like the coding is correct in the xml file. The CSV lists "ImperatoriCaesari" and "ImperatoriCaesariCaio" as single words. Shouldn't these be three separate entries in the word list?

emylonas commented 3 years ago

actuall - there is a supplied around 2 expan elements in jeru0497 which contradicts what we had said - 1 supplied around 1 word. I changed it. same problem with caes0106. fixed that as well, and will look for more expan inside supplied. I found two epan elements stuck together in caes0004, and changed that.

On Fri, Mar 26, 2021 at 12:40 PM Mylonas, Elli @.***> wrote:

Technically, the code should be able to pick that up, as any

... is a word, but we could add a space in between. best, --elli On Fri, Mar 26, 2021 at 12:36 PM Christopher B. Zeichmann < ***@***.***> wrote: > In some instances, adjacent words that both have the attribute > are mashed into a single word until there is a line break or a word lacking > the attribute. Looking at jeru0497: > > Caesari```` is currently being rendered as a single word: ````ImperatoriCaesari````. > > It should instead be two words: ````Imperatori Caesari````. > > See also this same phenomenon in caes0106: ````Imperatori Caesari Caio```` should be three words, but is currently being rendered as a single word. > > — > You are receiving this because you authored the thread. > Reply to this email directly, view it on GitHub > , > or unsubscribe > > . >
emylonas commented 3 years ago

Clarification - <expan> elements are single words, and so the <supplied> elements that may surround them would have to be broken up into separate <supplied> around each <expan>. I did this for all the multiple words that were inside supplied> but didn't catch the 12 or so multiple <expan>s. Doing so now.

zeichman commented 3 years ago

There are a number of instances where a given word has white space in the middle because of white space between the <abbr> and <ex> elements. For instance (and I have since corrected this): caes350 reads very strangely in the csv file: <w xml:id="caes350-2" xml:lang="la"><expan><abbr>le<w xml:id="caes350-3" xml:lang="la"><supplied reason="undefined">g</supplied></w></abbr> <ex>ionis</ex></expan></w>

There are a few issues. 1) There is a word nested within another word (i.e., the letter "g" is treated as its own word. 2) The space between at </abbr> <ex> leads it to not be recognized as the word "legionis" but as a "leg ionis" (which is still a single word, just with a space in it).

I wonder if it is possible to eliminate white space between </abbr><ex> via global chance to fix the second of these. I've noticed others with the same problem (e.g., "ἠ μέρᾳ" in zoor231, "Ἐπιφάνι ος" in hamm0046).

I think the word-within-the-word is related to the supplied issue (#12 ) that I noted a few days ago.

emylonas commented 3 years ago

I can remove the spaces inside the <expan> elements. I had mostly removed spaces between <abbr> and <ex> a while back.

On Wed, Mar 31, 2021 at 8:23 PM Christopher B. Zeichmann < @.***> wrote:

There are a number of instances where a given word has white space in the middle because of white space between the and elements. For instance (and I have since corrected this): caes350 reads very strangely in the csv file: le<w xml:id="caes350-3" xml:lang="la"><supplied reason="undefined">g ionis

There are a few issues. 1) There is a word nested within another word (i.e., the letter "g" is treated as its own word. 2) The space between at

leads it to not be recognized as the word "legionis" but as a "leg ionis" (which is still a single word, just with a space in it). I wonder if it is possible to eliminate white space between via global chance to fix the second of these. I've noticed others with the same problem (e.g., "ἠ μέρᾳ" in zoor231, "Ἐπιφάνι ος" in hamm0046). I think the word-within-the-word is related to the supplied issue (#12 ) that I noted a few days ago. — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub , or unsubscribe .
zeichman commented 3 years ago

I noticed another issue with expan tags. Is there a way to prevent irrelevant information from creating white space? For example (zoor0106): <expan><abbr><choice><corr>Κ</corr><sic>Τ</sic></choice></abbr><ex>ύρι</ex><abbr>ε</abbr></expan> becomes <w>Κ ύριε</w> with white space in the middle. I'm guessing this means it won't line up with Κύριε proper.