aspell-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Aspell-user] Using aspell to search cities


From: Gary Setter
Subject: Re: [Aspell-user] Using aspell to search cities
Date: Mon, 26 Sep 2005 08:36:23 -0500

----- Original Message ----- 
From: "Scott Gifford" <address@hidden>
To: <address@hidden>
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





reply via email to

[Prev in Thread] Current Thread [Next in Thread]