local dictionary = {} local function insertWord(dict, word) local head, tail = word:upper():match('^(%a)(%a*)$') end insertWord(dictionary, 'BAG')