[SimpleParse] Re: Case insensitivity
Brought to you by:
mcfletch
From: Paul P. <pau...@ho...> - 2003-08-23 19:51:16
|
Mike Fletcher wrote: >Paul Paterson wrote: > > > How do people usually handle case-insensitive matching? > > > Usually (until now) I've just hacked it by explicitly creating [aA][tT] > ranges in the very few cases it came up. However, given that it's an > occasional request, I've just added support for it to SimpleParse. > > Usage is like so: > > production := c"match without case" # not 'c' prefix > > which will match at run-time as if the production had been > spelled: > > production := ([mM],[aA],[tT],[cC],[hH],' ',[wW],...) > > Implication being that case-insensitive literals are *far* heavier than > regular literals (probably a few orders of magnitude slower), as under > the covers they are actually creating a sequential group with literal > and range sub-elements. Runs of multiple non-case-carrying letters will > be treated as a single literal, BTW. Wow - thanks! I'll try this out as soon as SF CVS catches up. I'll do some timing comparisons and let you know what effect it has. I'm not too concerned about absolute speed for my application because I think that I can have an option for case insensitive searching (when I will switch grammars). Paul |