+ BUG(RAN_OFF_END_OF_VOCABULARY_TABLE); // LCOV_EXCL_LINE
+}
+
+int get_motion_vocab_id(const char* word)
+// Return the first motion number that has 'word' as one of its words.
+{
+ for (int i = 0; i < NMOTIONS; ++i)
+ {
+ for (int j = 0; j < motions[i].words.n; ++j)
+ {
+ if (strcasecmp(word, motions[i].words.strs[j]) == 0)
+ return(i);
+ }
+ }
+ // If execution reaches here, we didn't find the word.
+ return(WORD_NOT_FOUND);
+}
+
+int get_object_vocab_id(const char* word)
+// Return the first object number that has 'word' as one of its words.
+{
+ for (int i = 0; i < NOBJECTS + 1; ++i) // FIXME: the + 1 should go when 1-indexing for objects is removed
+ {
+ for (int j = 0; j < objects[i].words.n; ++j)
+ {
+ if (strcasecmp(word, objects[i].words.strs[j]) == 0)
+ return(i);
+ }
+ }
+ // If execution reaches here, we didn't find the word.
+ return(WORD_NOT_FOUND);
+}
+
+int get_action_vocab_id(const char* word)
+// Return the first motion number that has 'word' as one of its words.
+{
+ for (int i = 0; i < NACTIONS; ++i)
+ {
+ for (int j = 0; j < actions[i].words.n; ++j)
+ {
+ if (strcasecmp(word, actions[i].words.strs[j]) == 0)
+ return(i);
+ }
+ }
+ // If execution reaches here, we didn't find the word.
+ return(WORD_NOT_FOUND);
+}
+
+int get_special_vocab_id(const char* word)
+// Return the first special number that has 'word' as one of its words.
+{
+ for (int i = 0; i < NSPECIALS; ++i)
+ {
+ for (int j = 0; j < specials[i].words.n; ++j)
+ {
+ if (strcasecmp(word, specials[i].words.strs[j]) == 0)
+ return(i);
+ }
+ }
+ // If execution reaches here, we didn't find the word.
+ return(WORD_NOT_FOUND);