parameters: (self, database, query, spelling_query)
return_statement: return ' '.join(term_set)
docstring: Private method that returns a single spelling suggestion based on
          `spelling_query` or `query`.
  
          Required arguments:
              `database` -- The database to check spelling against
              `query` -- The query to check
              `spelling_query` -- If not None, this will be checked instead of `query`
  
          Returns a string with a suggested spelling
docstring_summary: Private method that returns a single spelling suggestion based on
          `spelling_query` or `query`.
docstring_tokens: Private method that returns a single spelling suggestion based on spelling_query or query .
function: def _do_spelling_suggestion(self, database, query, spelling_query):
          """
          Private method that returns a single spelling suggestion based on
          `spelling_query` or `query`.
  
          Required arguments:
              `database` -- The database to check spelling against
              `query` -- The query to check
              `spelling_query` -- If not None, this will be checked instead of `query`
  
          Returns a string with a suggested spelling
          """
          if spelling_query:
              if ' ' in spelling_query:
                  return ' '.join([database.get_spelling_suggestion(term) for term in spelling_query.split()])
              else:
                  return database.get_spelling_suggestion(spelling_query)
  
          term_set = set()
          for term in query:
              for match in re.findall('[^A-Z]+', term):  # Ignore field identifiers
                  term_set.add(database.get_spelling_suggestion(match))
  
          return ' '.join(term_set)
function_tokens: def _do_spelling_suggestion ( self , database , query , spelling_query ) : if spelling_query : if ' ' in spelling_query : return ' ' . join ( [ database . get_spelling_suggestion ( term ) for term in spelling_query . split ( ) ] ) else : return database . get_spelling_suggestion ( spelling_query ) term_set = set ( ) for term in query : for match in re . findall ( '[^A-Z]+' , term ) : # Ignore field identifiers term_set . add ( database . get_spelling_suggestion ( match ) ) return ' ' . join ( term_set )