"kojaa" and other question words are easy to find.
In Persian, pronouns are connected to other words (nouns, adjective, adverb,verb, object and subject).
So, we must look for every word solely without connected pronoun.
And about verbs, the infinitive should be searched. Moreover, note that some verbs are "compound verb" and it's necessary to know them and search their compound form infinitive. "gom kardan" for instance.
About sentence "کجا گمت کردم", the following forms should be looked for:
کجا---- کجا
گمت کردم --- گم کردن