Monday, April 21, 2014

Rohoncian looks like a case-marking language with prepositions

The computer-assisted transcription of the Rohonc codex is about 61% done. So far, I'm resisting the urge to do any kind of statistical analysis because the results will almost certainly be skewed by the fact that my glyph recognition algorithm has a harder time with some glyphs than others.

However, I came across something today that I thought was interesting. Throughout the codex, there is a sequence of four glyphs that is usually written with a halo over it, as follows:

Co D Co D

Starting from this post, I'll use my provisional transcription system, so I don't have to talk about "the glyph that looks like a triangle", and so forth.  So this sequence is transcribed as Co D Co D.

I think the odds are good that this is a noun, or a proper noun, but of course it is not clear what it is. It could be an epithet of God, the Holy Spirit, or even an abstract noun like Grace, but for the sake of convenience I'll call it "the holy noun". At first blush, it looks like a reduplicated stem, but there are a few cases where it appears to be inflected.

In an earlier post, I suggested that the simple line bending to the left was a preposition line "on". I now transcribe this glyph as L (for "left"), and in the following sequence you can see two cases where the holy noun is preceded by L, and at the same time the ending of the sequence changes:

L C D C I Ix Hk L C D C I

It may or may not be important, but in this case the glyph Co is replaced by C. But since the only difference between the two is a small loop at the top, it is possible that they are allographs of the same grapheme.

More important is the suffix. It looks like the (tentatively) nominative suffix D becomes I when the noun is prefixed by the preposition L.

Compare also the following:

O Co D C D C

It seems fairly clear that this is the same holy noun (marked with a halo, as always), but it has an added C suffix after the D. This may or may not be related to the O that precedes the whole word.

If these sequences really do show prepositions and case-marking, then it narrows the field of candidate languages quite a bit. We would be looking for a language with prepositions and at least three cases. Here is the rough paradigm of a noun in -D:

Possible Nominative: stem + D
Oblique A: stem + I
Oblique B: stem + D C

Thursday, April 10, 2014

Dividing work between man and machine

This project to write a text recognizer for the Rohonc codex has been really rewarding. The quality of the text is so poor that the solutions have to be really clever, and that is what makes it so fun. I've learned a massive amount about image manipulation and text recognition, and I have a whole slew of projects I want to undertake when I'm done with this one.

I've probably spent four hours training my glyph recognition algorithm, and I think it probably identifies glyphs correctly about 80-90% of the time. Right now, I can process a single line of text in under a second, but it takes me about 15-30 seconds to manually verify the transcription and fix any errors that crop up. That seems pretty fast, but when you multiply it out by 4285 lines, it comes to about 25 hours of manual work. I need to pare that down, because it'll take me forever to scrape together 25 hours of free time.

A lot of this project has involved dividing labor between me and the machine, making the most of what the machine can do without my intervention, and making the best use of my feedback on good and bad matches. The code has been very fluid but very stable, basically organized around building a powerful set of core functionality, but using the simplest and most ergonomic user interface for each task.

Friday, March 21, 2014

Starting the final phase of Rohonc transcription (I think)

I think I've finally settled on a workable process for machine-assisted transcription of the Rohonc Codex.

I tried several approaches before landing on the current one. One approach was to analyze each page in a top-down way, first identifying the areas that contained text, then splitting those into lines, and splitting the lines into glyphs. The other approach was bottom-up: First, identify glyphs, then identify lines.

No single automated process was able to correctly split the pages up 100% of the time, so I have adopted a top-down automated approach with manual overrides. I have now broken all of the pages down to the line level, and I have some code that picks out glyphs from a line with great accuracy.

Now comes the fun part: writing (and training) the glyph-recognition algorithm.

I've decided to use the "mark" as my fundamental unit of text. A mark is a single, contiguous, dark shape on the page within the bounds of a text line. Many Rohonc glyphs consist of a single mark, but many consist of core mark with one or more satellite marks. Most satellite marks are single dots above or to the left of the core mark, but some marks are dashes, and some are haloes that surround a core mark.

My glyph-recognition algorithm will start out by finding the best match between the glyphs on a new line and any that have been previously identified. This will be followed by a manual intervention step where I can correct any incorrect automated matches, or reject a mark as being non-text. When the line has been completely treated, constellations of marks will be matched to known glyphs.

I have wrestled with several different approaches to matching marks. One approach is to simply overlay one mark upon another and determine the total number of dark points that are the different, and calculate the ratio between that number and the full number of points.

Another approach that I am toying with is to use a two-dimensional version of Levenshtein distance. One way to do that would be to treat each row and column of the mark bitmaps as a string, calculate the individual Levenshtein distances, and sum them up to come up with a total distance.

But some calibration would be needed to make an apples-to-apples comparison between different match scores.

Sunday, March 9, 2014

Interesting features of Rohonc script and character recognition

I've been working on code that can scan the images of the Rohonc Codex and help me transcribe it. Hopefully I will be able to complete the transcription relatively quickly with the assistance of some code that can recognize and categorize graphemes (and remember what wacky name I decided to give each character).

In the process, I have unearthed a wealth of interesting detail and challenges.

Regarding the grapheme recognition process, the challenges are many. The script is hand-written, the lines are irregular, and the scanned pages are not necessarily orthogonal to the images. My approach is to identify individual marks, place them in a network together with other similar marks, and differentiate them based on the local density of the area of the network in which they appear. Then, I think I can recognize constellations of marks as graphemes, and start training the program to do the transcription.

It is clear to me at this point that this is going to be more of a computer-assisted transcription project than a pure computer transcription, but even so the work should go much more quickly with the aid of a machine whose eyes never tire.

One of the challenges I have had to overcome is distinguishing between stray dots on the page and the dots that are intended to be part of a grapheme. Unless I am mistaken, it appears that the dots that accompany a grapheme always appear above or to the left of the main shape of the grapheme. I suspect this is related to the right-to-left direction of the text.

In categorizing the graphemes, I am running into a problem I have wrestled with for years, ever since I first started thinking about ways to automate the recognition of patterns. I call it the "cloud-within-the-network" problem, and I need to find out what the proper answer to it is.

The "cloud-within-the-network" problem works like this: Suppose you have some dense networks, and you loosely connect them to each other in a larger network. How do you computationally recognize the existence of the dense networks within the larger loose network?

It seems like it should be relatively simple, but every solution I think up seems to have a problem with it. In the case of this transcription project, I have a workaround, but some day I would like to find the right solution.

Monday, March 3, 2014

Rohonc Transcriber (stage 1)

In a recent post, I said I would write a program to transcribe the Rohonc Codex.

Tonight I did the first part. I wrote some code to identify lines of text and graphemes. The image below shows a page of text, with the first-pass graphemes marked by green rectangles.


This is just a first pass. Some of these rectangles enclose multiple graphemes, and they will need to be split apart.

Next, I think I'll build a database of all of the grapheme images, then compare them to each other to identify image families.

Sunday, March 2, 2014

One possible explanation for the reference to "John 22"

In a recent post, I noted a problem with an apparent scriptural reference to the book of John chapter 22. The book of John only has 21 chapters according to the modern system of division, and in the Byzantine manuscripts that I have been able to find, there are only 18 or 19 kephalaia.

However, in the section of the RC in question, the number 22 is written with the number 2 followed by the number 20, as though it were the Roman numeral IIXX.  I had thought this meant "two and twenty", but another explanation could be that this is a language where the number 18 is expressed as "two from twenty".

The only language I can think of at the moment where this is done is Latin: duodēvīgintī, but there may be others. Indeed, it turns out the Romans sometimes wrote 18 as IIXX, which lends a little weight to this hypothesis.

For this explanation to work, we would have to assume that the references are to a copy of the New Testament that is divided according to an earlier system like the Byzantine kephalaia.

If so, then this passage may offer us a good crib. I may look into that this evening.

Transcription of the Rohonc Codex

It's time for a free and open transcription of the Rohonc Codex.

Unfortunately, I don't have the time to do it by hand, and we do not yet have a universal crowd-sourcing platform where I can set it up. So I'll write a program to scan the images and do an initial pass at automating the transcription.

When it is done, I will release it for free.

Edit: I did get a long way on the transcription, but life intervened so it is not yet complete. The latest revision of the transcription is here: http://quint.us/Roho/.