encukou/test-1 — Issue #10: "Find a thing named X" function
Author: encukou
Created: 2011-11-03 18:35:11+00:00
State: open
Labels: assigned-to Eevee, feature, fixed-in Beta 2- Moves, involved

**Reported by [Eevee](http://bugs.veekun.com/users/1) on 2009/05/03 01:14:46 +0000 · Migrated from [Redmine issue 15](http://bugs.veekun.com/issues/15)**

---

Needed for general lookups from the app. Needs to support:
\* Selecting only a certain type (types?) of object. There are long-standing bugs in the veekun search where entering ‘Psychic’ as a move doesn’t return anything because the lookup code thinks it’s a type first.
\* Along the same lines, reasonable priority for types of objects. Pokémon override moves override types override etc etc.
\* Fuzziness. Should it return just a list in order of likeliness, or tuples containing match percentages? Keep in mind that we need to handle both returning multiple items with exact-match names (Psychic) and returning multiple items because there was no exact match (Nidoran).
\* TESTS. This is a GREAT place to write tests! This thing should be very self-contained and testing should be dead simple. ALSO, have some tests that ensure that very simple fuzzy results have the correct first (only?) match.

I think all the things we would want to find by name are: Pokémon, moves, abilities, types, items, locations. Anything else?

Redmine metadata:
Updated on: 2010/04/13 19:28:54 +0000
Start date: 2009/05/03
Relations:
blocks #16
blocks #17

---

**Comment by [Eevee](http://bugs.veekun.com/users/1) from 2009/07/25 04:50:24 +0000**

We’re getting there. Still need to add alternate modes of lookup, e.g., by national dex number.

Also, I don’t know what exactly to do about other languages. I can try to fuzzy-match roomaji, but something like kana simply will not work with the whoosh library. Is this okay? Does anyone use it? Could I just transliterate the kana and try to fuzzy-match that? Hm.
Speaking of languages, people have been confused about fuzzy results before because the name matched a different language, so we might have to modify what lookup () returns. Some more. Ick.

---

**Comment by [Eevee](http://bugs.veekun.com/users/1) from 2009/07/27 01:10:27 +0000**

Hacked around the speller’s refusal to work with non-words.

Still needed: make it use a file in data/ on startup somehow and check to see if the file already exists, so different Pylons threads can share it.

---

**Comment by [Eevee](http://bugs.veekun.com/users/1) from 2009/08/12 20:34:06 +0000**

Difficulty: Involved

---

**Comment by [Eevee](http://bugs.veekun.com/users/1) from 2009/08/12 22:42:04 +0000**

Target version: — ⇨ 6

---

**Comment by [Eevee](http://bugs.veekun.com/users/1) from 2009/08/13 15:27:09 +0000**

I believe this still needs…
\* Languages—as a fallback, or first-class citizen?
\* These need to only return ONCE! How do I do this?
\* Restriction by class
\* Other methods of lookup?
\* Create an index on startup (install?) somehow. Might spin this off along with the problem of when to create a database.

---

**Comment by [Eevee](http://bugs.veekun.com/users/1) from 2009/08/23 22:48:49 +0000**

**DONE.**

---

**Comment by [Eevee](http://bugs.veekun.com/users/1) from 2009/08/23 22:49:21 +0000**

DONE ALSO ACTUALLY MARKING AS DONE.

Status: OPEN ⇨ FIXED
: fixed

---

**Comment by [Eevee](http://bugs.veekun.com/users/1) from 2010/04/13 19:28:54 +0000**

Target version: 6 ⇨ Beta 2: Moves