tallforasmurf / PPQT

A post-processing tool for PGDP written in Python, PyQt4, and Qt
GNU General Public License v3.0
4 stars 2 forks source link

Add a transliteration interface #132

Open bibimbop opened 11 years ago

bibimbop commented 11 years ago

For books with greek, and possibly other alphabets, a transliteration interface similar to guiguts would be nice to have.

I realize this one would be a lot of work though, so if it ever comes to fruition, it should be carefully though.

A few things that should be done:

DChars (http://94.23.197.37/dchars/doc/en/index.html) might be handy here for the transliteration, although it doesn't know the PG format.

tallforasmurf commented 11 years ago

I have done books with Greek and used the guiguts Greek dialog, it is a marvel of design, much superior to the one in the proofing web interface. I've always meant to have something like it -- someday! I note you don't mention being able to output beta-code? Or output HTML entities? Both of which Guiguts's dialog will do. I used this to actually make [Greek: Ἀχιλλεύς : Achilleus : Αχ....etc] and then use regexes to convert into HTML with popup beta-code labels.

As you say this would be nontrivial to do, replicating that UI in Qt, and it isn't clear right off how it would fit into my tab-oriented interface. Hmmm - its own tab like the Footnotes tab, click Refresh to gather all Greek strings into a table... First column, "Line" shows the line number of the (start of) the [Greek string. Click it to jump the edit cursor there. Next column is "Greek", click in it and your keyboard entry mode switches to Greek (with a keyboard diagram visible somehow) and as you type or edit the Greek letters, the "Beta" and "Entity" columns update automatically? Need keyboard conventions for entering the accents. How do you signal "done, put it back" -- just hitting Enter with the cursor in the edited Greek column?

So this would be semi-automated as you seem to be suggesting. On "Refresh" finding the [Greek: sections, picking up the Unicode Greek glyphs, and generating a suggested transliteration if one is not already in the bracketed section. Wouldn't accents be a problem?

Re spellcheck: how about if PPQT automatically switched dictionaries when it saw [Greek: and switched back to the main language when it saw either colon or right-bracket? Then no special UI needed for that.

There would also be a market, so to speak, for a Cyrillic xliteration UI. I did a book that had significan Cyrillic phrases. Not fun.

bibimbop commented 11 years ago

I don't much about greek. I only know that when I see some, I start sweating because I always get it wrong. Hence my wish to automate as much as possible. As for the accents, as long as the input is properly translated, it's good; it can then be fixed. And I think the guiguts version is a pita to use, by having to switch back and forth between ascii<-->greek. It's not friendly, at least to me.

I can't say about the spellcheck, because I create a text version and use libreoffice to do the checking; there's a grammar checker too there, at least for French. But here I see a use.

tallforasmurf commented 11 years ago

I am trying to finish a huge PP book, but in a couple of weeks I should have the time and will proceed as follows.

First, a canonical transliteration markup as I will support it has up to three parts, [Greek: greek-letters : beta-code : entities ] for example

[Greek:Έλλας:Hellas:&#0388;&#03BB;&#03BB;&#03B1;&#03C2]

The beta-code and entities are optional. Spaces in the first two sections are significant.

User puts edit cursor anywhere inside such a field and selects Edit>Greek (or an accelerator key TBD). If the cursor is not inside a transliteration field only a beep happens. Else the entire transliteration field is selected in the edit window, and a new, modeless window appears.

Top field is a text edit field pre-loaded with the greek-letters. (If there is only one field present and it contains any characters <127 I will assume it is betacode only, like [Greek:Hellas] and try to reverse-engineer the greek letters from the betacode.) Below this are labels (not editable) showing the corresponding beta-code and entities. These update live as the greek is edited.

Below these are character entry buttons comparable to the ones in the Guiguts or Proofing interface dialogs, but I have a couple ideas to make them nicer. Also a convention for keyboard entry is active when this window has the focus - TBD, but something like: lowercase a, b, etc. produces lowercase greek; shift-letter produces capital greek; control- adds the Tonos to upper or lower case. (What's the guiguts convention for terminal-sigma versus intermediate sigma? Must check.)

User edits the Greek symbols in the top field. ctl-plus/minus zooms the font size. Because it's modeless, you can go to the Pngs panel and zoom that up and position it to make the original greek nice and big, and then position and size the greek window so you can see the original and the input field at the same time. It remembers its last position and size when next opened.

Below the greek entry are action buttons.

Cancel (or Esc key) cancels the dialog, nothing changes (but field is no longer selected in edit window -- so you won't erase it by accidentally hitting the space bar).

Update (default selected by Enter) rewrites the transliteration field in canonical form with the current edited text.

I would also provide two Find/rep loadable buttons, one for changing a canonical transliteration field in HTML and one into Etext. The HTML version comes out to <span class='greek' title=' beta-code '> entities </span> What's the etext supposed to be... must check.

Please feel free to comment.

bibimbop commented 11 years ago

Does anyone uses beta-code ? I've never seen it.

The html I've been using is <span lang="grc" xml:lang="grc" title="ganos">γανος</span>

If an html document contains greek, utf-8 encoding should be preferred. Entities are a huge and unnecessary pain to work with. I wouldn't provide the option.

I would avoid using : as a separator since that can appear in greek (I'm sure I've seen it once). I'd pick something else, like | or %.