pcplantdb@lists.ibiblio.org
Subject: pcplantdb
List archive
Re: [pcplantdb] Eden 0.1.3 release - testing search again
- From: Chad Knepp <pyg@galatea.org>
- To: Permaculture Plant Database <pcplantdb@lists.ibiblio.org>
- Subject: Re: [pcplantdb] Eden 0.1.3 release - testing search again
- Date: Fri, 24 Dec 2004 07:34:32 -0600
Richard Morris writes:
> Lawrence F. London, Jr. wrote:
> > Chad Knepp wrote:
> >
> >> Well, I can think of a couple of reasons. Elaeagnus has an 'a' in it
> >> that I forget a lot myself. Eden does accommodate 'alternative'
> >
> Spelling of latin names is a big issue.
> The way I've handled this is to put every concievable spelling as a
> synonym.
Interesting. I've handled it very differently. Eden separates words
into substrings and looks for names that are 'like %substring%'. If
you spell the word correctly every substring matches. If you butcher
it, hopefully some of the substrings will match. I've found this to be
both very simple and very effective solution. One of the performance
enhancing changes I made recently was decreasing the number of
substrings a word is seperated into. Perhaps I've changed it too far
the other way.
Just for fun, I'm appending the substring method from Eden/Search.py.
I think it's a neat bit of code.
--
Chad Knepp
python -c 'import base64;print base64.decodestring("cHlnQGdhbGF0ZWEub3Jn")'
def subStrings(word, substrings, min_len = 3):
"""
Suppa duppa substring smashing action! Hi-Yaaaaa....
Divides 'word' into 'substrings' number of sub strings that
have a minimum number of characters of 'min_length'
Returns list of sub strings
"""
strings = []
increment = len(word) / substrings
extra_chars = len(word) % substrings
if increment < min_len:
increment = min_len
extra_chars = len(word) % min_len
substrings = len(word) / min_len
for chunk in range(substrings):
if extra_chars:
strings.append(word[:increment+1])
word = word[increment+1:]
extra_chars -= 1
else:
strings.append(word[:increment])
word = word[increment:]
return strings
-
Re: [pcplantdb] Eden 0.1.3 release
, (continued)
-
Re: [pcplantdb] Eden 0.1.3 release,
Richard Morris, 12/21/2004
- [pcplantdb] Topic index pages, John Schinnerer, 12/22/2004
- Re: [pcplantdb] Eden 0.1.3 release, Chad Knepp, 12/20/2004
-
Re: [pcplantdb] Eden 0.1.3 release,
Lawrence F. London, Jr., 12/19/2004
-
Re: [pcplantdb] Eden 0.1.3 release,
Chad Knepp, 12/20/2004
-
Re: [pcplantdb] Eden 0.1.3 release,
Lawrence F. London, Jr., 12/20/2004
-
Re: [pcplantdb] Eden 0.1.3 release - testing search again,
Lawrence F. London, Jr., 12/22/2004
-
Re: [pcplantdb] Eden 0.1.3 release - testing search again,
Chad Knepp, 12/23/2004
-
Re: [pcplantdb] Eden 0.1.3 release - testing search again,
Lawrence F. London, Jr., 12/23/2004
- Re: [pcplantdb] Eden 0.1.3 release - testing search again, Richard Morris, 12/24/2004
- Re: [pcplantdb] Eden 0.1.3 release - testing search again, Chad Knepp, 12/24/2004
- Re: [pcplantdb] Eden 0.1.3 release - testing search again, Plants For A Future, 12/26/2004
- Re: [pcplantdb] Eden 0.1.3 release - testing search again, Chad Knepp, 12/26/2004
-
Re: [pcplantdb] Eden 0.1.3 release - testing search again,
Lawrence F. London, Jr., 12/23/2004
-
Re: [pcplantdb] Eden 0.1.3 release - testing search again,
Chad Knepp, 12/23/2004
-
Re: [pcplantdb] Eden 0.1.3 release - testing search again,
Lawrence F. London, Jr., 12/22/2004
-
Re: [pcplantdb] Eden 0.1.3 release,
Lawrence F. London, Jr., 12/20/2004
-
Re: [pcplantdb] Eden 0.1.3 release,
Chad Knepp, 12/20/2004
-
Re: [pcplantdb] Eden 0.1.3 release,
Richard Morris, 12/21/2004
Archive powered by MHonArc 2.6.24.