
16 Apr
2009
16 Apr
'09
3:08 a.m.
2009/4/16 Michael Mossey
I don't think I would create a parser language that includes every variant, but instead the field names would be tokens that could be passed to another routine.
Right.
The variants could be generated ahead of time. I would limit the number of variants to something manageable, like 10,000 for each field name.
Generating variants ahead of time isn't necessary. Instead, you could just look at the edit distance between the token you get and each possible valid field name using something like http://hackage.haskell.org/cgi-bin/hackage-scripts/package/edit-distance. The token with the least edit distance is the one you should suggest. Cheers, Max