"Forward maximum match" mean that there is a dictionary contains
thousands of items which are single words. For example, "kid", "nice",
"best"...
And here get a string "kidnicebs", the forward maximum match algorithm
need to find the longest string that matches the string in dictionary.
Because the longest string in the dictionary has a length of 4, so the
algoritm pick the first four characters of the string(that's why it's
called forward):
kidn-------not find in dictionary
then, first three: kid --------find in dictionay
then kid is picked out as a segment, then the algorithm continue with
"nicebs"...
I'm wondering is there any fast algorithm to deal with this demand,
what kind of data structure should I use? Thanks for helping me.