Words near longest prefix matching in the dictionary