WakeLift
wakelift / lojban /

lojban-teachparse teaches parsing simple sentences (with update)

In order to help aspiring lojbanists pick apart simple sentences, I wrote my own parser (more or less), that would explain in steps, why it decided to do what it did, drawing boxy diagrams for each step. The way I did this was very bad, because essentially I tried re-implementing the lojban grammar, instead of using the official grammar. The sentences were pre-parsed using camxes, as part of the early error-checking by lojbansuggest, but many correct sentences were not correctly - or at all.

In my opinion, it's impossible to use the "original" parse tree. In order to make the newbie understand the sentence easily, a bit of abstraction would have to be done, that the official peg grammar does not really provide.

The cascading boxes effect, on the other hand, would probably be very nice to have for other parsers as well, because it makes start and end of constructs very easy to discern and generally looks cool.

Even though the codebase can probably not be salvaged, the ideas behind this program are - in my opinion - worth saving. Maybe someone with more skill at grammars/parsing/... could have a go at this project for great benefit to every newbie.

You can try the code on this server with simple sentences like "coi do lo gerku ui ku klama lo zarci", but many words/selma'o are not yet implemented. If the website is down, just drop me a line with the instant feedback at the bottom and I'll reboot it as soon as I can.

Update

Please write composite words as separate words (don't write rodo, write ro do.) or else you will immediately get a 500 internal server error.

This installation is mostly here for historical interest. I do not claim it would be fit for any purpose whatsoever.

Visual-Camxes

donri developed a Flask-Genshi app called "visual camxes" which takes the boxes idea and runs with it. Get the code and try it out!