def word_map(hub, word, words, r_words):
    """
    Take a word and build it into the dict map. Modify the words dicts in place and then
    return the int that represents the given word
    """
    if word in words:
        return words[word]
    num = len(words) + 1
    words[word] = num
    r_words[num] = word
    return num
