----- Original Message ----- From: "Scott Gifford" <[EMAIL PROTECTED]> To: <[email protected]> Sent: Sunday, September 25, 2005 9:36 PM Subject: [Aspell-user] Using aspell to search cities
> Hello, > > I'm using aspell to search a list of cities. For example, if a user > types in "phlent", I'll use aspell to suggest "Flint" for what they > really meant. I do this by building a custom dictionary with all of > the cities in my state (Michigan), then querying it with the > Text::Aspell Perl module. > > This works well for a lot of cities. But some have prefixes and > suffixes, and sometimes people enter prefixes and suffixes that aren't > there. In this case, Aspell doesn't find reasonable suggestions, > because the words are so far apart. For example, if there is a city > called "West Bloomfield" and I search for "Bloomfield", Aspell doesn't > have any suggestions. Similarly, if there is a city called "Flint" > and I search for "West Flint", Aspell doesn't have any suggestions. > > Does anybody have suggestions for dealing with this in Aspell? > > I've tried automatically adding prefixes and suffixes and including > Aspell's suggestions for the prefixed and suffixed words, but that > gives too many suggestions, and if I use a prefix like "North" cities > like "Northville" show up in nearly every suggestion list, which isn't > helpful. > Hi Scott, It sounds like an interesting project. It doesn't sound to me like your are trying to solve the same problem as aspell, but there is no reason not to start with aspell and create your own solution. How about this, play with the Working::get_suggestions() function in the suggest.cpp module. This is where each of the techniques for making suggestions are called. To make W. Bloomfield a valid suggestion for Bloomfield, you need to make a change here maybe. The other problem is scoring. What you are doing is counter to what aspell wants to do. If the user tries Detroyt Aspell wants to score detrain better then East Detroit because you have to change fewer letters. Your scoring needs to be more flexable. Best of luck, Gary _______________________________________________ Aspell-user mailing list [email protected] http://lists.gnu.org/mailman/listinfo/aspell-user
