parameters: (examples)
return_statement: return index
docstring: Create an inverted index based on words in title and shortdesc.  Keys are
      lower cased words.  Values are dictionaries with example index keys and
      count values.
docstring_summary: Create an inverted index based on words in title and shortdesc.  Keys are
      lower cased words.  Values are dictionaries with example index keys and
      count values.
docstring_tokens: Create an inverted index based on words in title and shortdesc . Keys are lower cased words . Values are dictionaries with example index keys and count values .
function: def wordIndex(examples):
      """
      Create an inverted index based on words in title and shortdesc.  Keys are
      lower cased words.  Values are dictionaries with example index keys and
      count values.
      """
      index = {}
      unword = re.compile("\\W+")
      keys = ["shortdesc", "title", "tags"]
      for i in range(len(examples)):
          for key in keys:
              text = examples[i][key]
              if text:
                  words = unword.split(text)
                  for word in words:
                      if word:
                          word = word.lower()
                          if index.has_key(word):
                              if index[word].has_key(i):
                                  index[word][i] += 1
                              else:
                                  index[word][i] = 1
                          else:
                              index[word] = {i: 1}
      return index
function_tokens: def wordIndex ( examples ) : index = { } unword = re . compile ( "\\W+" ) keys = [ "shortdesc" , "title" , "tags" ] for i in range ( len ( examples ) ) : for key in keys : text = examples [ i ] [ key ] if text : words = unword . split ( text ) for word in words : if word : word = word . lower ( ) if index . has_key ( word ) : if index [ word ] . has_key ( i ) : index [ word ] [ i ] += 1 else : index [ word ] [ i ] = 1 else : index [ word ] = { i : 1 } return index