WordTokeniser which searches the valid words having the longest prefix