From: Martin DeMello Date: 2005-02-25T05:05:00+09:00 Subject: Re: Optimisation help needed Martin DeMello wrote: > Robert Klemme wrote: > > > > There we some errors still. I did a bit of fixing and tidying up. Most > > interesting I find the simplification achieved by "EOW = > > DawgNode.new.freeze". > > Subtle problem: > current.children[char] = eoword ? DawgNode::EOW : nodes[ptr] > > doesn't work because a node could be both EOW *and* have children. But > looks like a very nice clean approach on the whole - will happily > replace my old code with this. (And yes, it turned out to be a very small fix - merely adding the eow attribute back to every node and saying if char != 0 current.children[char] = nodes[ptr] current.eow = eoword end plus a few supporting changes elsewhere.) martin