parameters: (self, wordlist, queries)
return_statement: return map(check, queries)
docstring: :type wordlist: List[str]
          :type queries: List[str]
          :rtype: List[str]
docstring_summary: :type wordlist: List[str]
          :type queries: List[str]
          :rtype: List[str]
docstring_tokens: : type wordlist : List [ str ] : type queries : List [ str ] : rtype : List [ str ]
function: def spellchecker(self, wordlist, queries):
          """
          :type wordlist: List[str]
          :type queries: List[str]
          :rtype: List[str]
          """
          vowels = set(['a', 'e', 'i', 'o', 'u'])
          def todev(word):
              return "".join('*' if c.lower() in vowels else c.lower()
                             for c in word)
  
          words = set(wordlist)
          caps = {}
          vows = {}
  
          for word in wordlist:
              caps.setdefault(word.lower(), word)
              vows.setdefault(todev(word), word)
  
          def check(query):
              if query in words:
                  return query
              lower = query.lower()
              if lower in caps:
                  return caps[lower]
              devow = todev(lower)
              if devow in vows:
                  return vows[devow]
              return ""
          return map(check, queries)
function_tokens: def spellchecker ( self , wordlist , queries ) : vowels = set ( [ 'a' , 'e' , 'i' , 'o' , 'u' ] ) def todev ( word ) : return "" . join ( '*' if c . lower ( ) in vowels else c . lower ( ) for c in word ) words = set ( wordlist ) caps = { } vows = { } for word in wordlist : caps . setdefault ( word . lower ( ) , word ) vows . setdefault ( todev ( word ) , word ) def check ( query ) : if query in words : return query lower = query . lower ( ) if lower in caps : return caps [ lower ] devow = todev ( lower ) if devow in vows : return vows [ devow ] return "" return map ( check , queries )