# encoding: utf8
-from collections import namedtuple
import os, os.path
import random
import re
import whoosh.scoring
import whoosh.spelling
+from pokedex.util import namedtuple
+
from pokedex.db import connect
import pokedex.db.tables as tables
from pokedex.roomaji import romanize
name, self.INTERMEDIATE_LOOKUP_RESULTS):
query = whoosh.query.Term('name', suggestion)
+ if type_term:
+ query = query & type_term
results.extend(searcher.search(query))
### Convert results to db objects