Monday, May 12, 2014

Rohonc Transcription 90% done

The last few weeks have been busy for me, both at work and at home. But in my spare time I have managed to push my computer-assisted transcription of the Rohonc codex to 90% completion.

There will be a lot of manual work ahead for the remaining 10%. There are a lot of oddball graphemes, smudges, damaged lines and so forth to dig through. When I am done, I will go back and revise my transcription system, because I have noticed some opportunities for improvement.

Luckily everything is in a huge...thing...that is like a database, but built specifically for this task. When I need to change the transcription, I can do so with a minimum of fuss.

Saturday, May 3, 2014

Meanwhile, in another universe...

I'm still working on the Rohonc transcription, but I thought I would post something amusing and light-hearted for a change.

I've always been bothered by the fact that time seems to only go in one direction, and to be orthogonal to the three spatial dimensions. Somehow it seems...arbitrary.

So imagine a universe where it worked differently: Imagine a four-dimensional universe where time moves outward from a central point, which I'll call the Origin. So, instead of the spatial universe being a three-dimensional slice moving through a four-dimensional space-time, instead it is more like the surface of an expanding hypersphere.

How would light move in a universe like this? If we require that the speed of light be constant in this universe, then the path of light must always be at a constant angle of deflection from a line radiating from the Origin. If the speed of light and the passage of time are constant, then light spirals away from the Origin, always bending at a constant angle of deflection.

What would it be like inside this universe? First, on a small scale, time would appear to be linear, the same way that the Earth appears to be flat, and gravity appears to go in only one direction. Second, on a larger scale, the universe would constantly be expanding.

Now, suppose light is deflected as a result of some influence exerted by the Origin, and that influence decreases the further from the Origin we get. (Maybe inversely proportional to the cube of the distance from the Origin). Since we require that the speed of light be constant, the actual rate of passage of time relative to distance from the origin decreases the farther out we get. Since the size of the universe is proportional to the cube of the distance from the Origin, but time passes increasingly slowly, we would perceive this as an accelerated expansion of the universe.

Chores call, so that's the end of this post.

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 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.