I will try to explain my objective with an example which will be easier to understand.
Suppose I have a sentence like "A B C D E F G H".(Each word seperated using single space).
I have a Database like:
B C D E
A B
F G
C D E F G
..
I need to find the maximum number of units from the Databasedatabase that match the sentence.The The outcome should be as such that C"C D E F GG" should be disocvered first instead of B"B C D EE" and aferafter finding C"C D E F GG" only the remaining part of the sentence should be matched with Databaseagainst the database. Any change/suggestion in my process are acceptedis welcomed.
The maximammaximum match units can be anywhere in the sentence.The problem here is that I could not come up with an algorithm which I can accomplish mythis task.