Thursday, 11 January 2007

morphahuh?

Ok, I guess I've figured out some of the morph issues: one of which is a zip-with-mismatched-lists issue, where you have two lists that you're really expecting to be the same length and you zip them together. Mere zipping doesn't capture this requirement, though. You have to explicitly use a zip (or zipWith) that matches these lengths (for example, one that has an undefined when the patterns doen't quite match). Case here is that I have a list of input sentences [String], and I want to return a list of output sentences [String]. I never express anywhere that there should be exactly one output sentences for every string, but in fact (to my surprise), I am because I'm zipping them back together at some stage. Leads to well-typed, but very unpredictable results like "whhaaat? why am I missing half of outputs?" I suppose the correct approach to this would be either to (1) express the length-match requirement in the type system (2) at least be undefined when there is a match. Blowing up sucks, but it's better than doing something unexpected.

Ambiguity, ambiguity. I've taken up a notational convention to deal with ambiguity. When there are two many results for a single lemma, I do not return all of them. Instead, I return the lemma annotated with a '*' to indicate that this one was way too ambiguous, most likely indicating that something had gone wrong. Similarly, if there are no matches in the morph lexicon, I return a lemma with a '-' tacked on to it.

Sooooo tired. Goofed off all night on the net, so got maybe a couple hours sleep. Took me till 15:30 to leave the house. Guess I'll have to make it up by coming to the lab on the weekend. Sigh. I dunno. Maybe this is my chance to deliver the decisive blow, maybe this is time we upgrade from the aggressive sleeping campaign to the radical sleeping campaign. Hard reset?

No comments: