This month has been all about the Text Parser. I'm pushing to get this latest revision done, and that has crowded out other work for the moment. The big thing I cracked this month - the thing this Parser revision was mostly aiming at - was the ability to nest branches and dependent clauses inside each other.
Photo by Ed Vaile ("Edric") from Palmpedia |
What I call "branching" takes place when there is a coordinating conjunction in the sentence (like "and" or "but"). Branching can produce simple compounds, as in "Cats and dogs are animals." But sentences can also divide at any point and continue along two separate paths, as in "I fed the dog his dinner and gave Sarah her book." Or start out divided at the beginning and merge, as in "Are you or are you not a man?" Adding conjunction processing and branch management was one of my major accomplishments from last year. But this first version only really supported conjunctions in the uppermost layer of the sentence - not inside or between dependent clauses. Any interaction between branching and that other vital feature - nesting - had the potential to confuse the parser horribly. Not to mention that the code was a huge mess.
I'm a big believer in the design process that goes "Make a sloppy version that works; refine it later." Later became now and it was time to refine. I'm happy to report that I think I got clearer and better-organized code out of this month's work, in addition to enabling some sentences I couldn't manage before. Such as:
What you need and what you want are different things.
If you want or need the box, I can get it.
I don't know how you and Jack plan to find food.
There's still a ton of polishing to do and other small features to reintroduce, but this was the big hurdle.
Until the next cycle,
Jenny
I'm also a major believer in the theory of "get it working first, refine it later."
ReplyDeleteHaving perfectly refined and optimized code is completely wasted effort if the code doesn't work or you find out that the actual requirements differ from what you'd initially expected.