Trim and encode rhyme query