in reply to Re: Fasten up NGram generation code?
in thread Fasten up NGram generation code?

More elegant? I do have to disagree with that. Your regex is awkward to modify it to ngrams of different sizes. What if you want to count all substrings up to a length of 10? Or what if you want to count all substrings?

Abigail

Replies are listed 'Best First'.
Re: Re: Fasten up NGram generation code?
by ysth (Canon) on Jan 09, 2004 at 16:41 UTC
    To clarify, I meant more elegant than the OP, not than your regex.
      Yes, I was assuming you meant that. I still find the OP's approach easier to modify to include different substring lengths.

      But I'm quick with cut-and-paste.

      Abigail