def _get_word_id(self, word):
        """Returns a word's id if it exists, otherwise assigns
        a new id to the word and returns it.
        """
        if word not in self._word_to_id:
            self._word_to_id[word] = self._num_words
            self._num_words += 1
        return self._word_to_id[word]
dataset/ETHPy150Open oppia/oppia/core/domain/classifier_services.py/StringClassifier._get_word_id/original