Commit graph

26 commits

Author SHA1 Message Date
Eevee
3ea814661f Lookup no longer crashes if all type prefixes are bogus. 2010-03-15 00:10:09 -07:00
Eevee
a7496ec617 Fixed comments in pokedex.lookup. 2010-02-02 00:07:26 -08:00
Eevee
0a706d44a3 Added ISO-3166 country codes to languages table and lookup. 2009-11-23 21:50:45 -08:00
Eevee
04a2e3fd3d Prefix lookup is now case-insensitive. 2009-10-11 00:39:52 -07:00
Eevee
c66fe4042c Added a prefix_lookup() function, for suggestions. 2009-09-28 20:59:53 -07:00
Eevee
5deb9b2d16 Fixed use of split() in lookup. Now strips whitespace. #94 2009-09-13 20:09:31 -07:00
Eevee
f5853c0a0b Added random lookup. #57 2009-08-24 22:59:39 -07:00
Eevee
9e3d8b317d Wildcard lookup! #89
Test suite no longer reloads the entire database.  Takes too long.

Factored out some magic numbers in lookup().
2009-08-24 22:04:55 -07:00
Eevee
11989d0db2 Some minor lookup refactoring.
Wrote a little add() function to clean up the duplication of
add_document().

Delete the index directory if it exists and we're being forced to
recreate it.
2009-08-24 21:50:19 -07:00
Eevee
293bcaf724 Added whoosh and sqlite files to .gitignore. 2009-08-23 20:46:21 -07:00
Eevee
909e61cc97 Added support for type: prefix and forme lookup. #15 2009-08-23 16:27:13 -07:00
Eevee
a7c0830e48 Return correctly-cased foreign names from lookup. #15 2009-08-22 20:49:07 -07:00
Eevee
a9a88ec3e4 Finally weight lookup results by language. #15 2009-08-22 19:44:57 -07:00
Eevee
9a20969336 Flesh out lookup by number. #15
Note that, unlike SVN veekun, entering "133" will return ANYTHING with an id of 133.
2009-08-22 18:56:02 -07:00
Eevee
2bc41e2c62 Added support for lookup by other language name. #15
English fuzzy matches are preferred, followed by Roomaji and then
everything else.

The return tuple from lookup() now has a `name` parameter for the actual
name that was matched.
2009-08-22 01:13:34 -07:00
Eevee
4e51867e95 Added lookup support for foreign language names. #15
Changed lookup()'s return value to be a list of named tuples so the
caller can know which language each result is in.
2009-08-21 00:30:01 -07:00
Eevee
0b5eba6620 open_index was returning an index instead of a SpellChecker. #15 2009-08-20 21:07:06 -07:00
Eevee
0a893be01d Allow lookup() callers to pass in their own whoosh indices. 2009-08-20 17:36:31 -07:00
Eevee
0300e01cff Removed whoosh hacks; 0.3 obviates them. #15 2009-08-18 23:50:35 -07:00
Eevee
16072ceb44 Added setup command and made lookup work sanely. #15
The setup command loads the default data into a default location, then
creates a whoosh index in a default location.

get_index is now open_index and can be made to explicitly recreate the
index.  It also actually opens the index if it already existed, even
across processes, now that FileStorage is working.

The lookup command takes no switches for aiming at a different database;
it only uses the default data stores.
2009-08-18 23:50:13 -07:00
Eevee
238487c908 Fixed whoosh index creation to work with 0.2.x. #15 2009-08-16 21:03:49 -07:00
Eevee
20d40364b1 Lookup search lowercases the term again; whoops. #15 2009-07-27 18:45:43 -07:00
Eevee
76d7bbe0e7 Added moves, types, items, and abilities to lookup index. #15 2009-07-26 23:18:11 -07:00
Eevee
cce9c26125 Removed the need for a spelling column in the lookup index. #15
Whoosh's spelling module unfortunately ignores any "words" that don't
look like words, even though the algorithm words fine with arbitrary
input.

I had to clone some code from whoosh.spelling, but avoiding the
isalpha() check solved a bunch of problems.  Now the index happily
compares against anything I feed into it.
2009-07-26 00:37:37 -07:00
Eevee
b13ffac247 Pokédex lookup now uses a whoosh index and spell-checker. #15 2009-07-25 01:28:33 -07:00
Eevee
f23a3401f2 Stubbing out a lookup function. #15 2009-07-21 00:12:25 -07:00