One Interview question i was asked in an interview and i was not get an solution.
Following is the sample paragraph and our program should give the hyperlinks for the words which mathes
"Network protocol Driver- A net-protocol fully Java technology-enabled driver translates JDBC API calls into a DBMS-independent net protocol which is then translated to a DBMS protocol by a server. This net server middleware is able to connect all of its Java technology-based clients to many different databases. The specific protocol used depends on the vendor. In general, this is the most flexible JDBC API alternative. It is likely that all vendors of this solution will provide products suitable for Intranet use. In order for these products to also support Internet access they must handle the additional requirements for security, access through firewalls, etc., that the Web imposes. Several vendors are adding JDBC technology-based drivers to their existing database middleware products"
The words for which we need to give hyperlinks are available in a database table say (URL Table)
Network protocol : www.network-protocol.com
net protocol: www.netprotocol.com
Question is how do you go about updating the links for the above 2 words in the paragraph?
I said I will proceed with the matching word by word and update the links.
If it was a single word matching and updating the url, we can defnitely do with this. but the length of words in the table may be 2 or 3 or 4 Max. then Matching doesnot work and we need to match exactly 2 words for example network protocol and net protocol.
For example if I am searching for protocol word there are many which are matching and chances updating wrong url will be more.
What is the best solution and is there any api availables to do this? If we can do with more efficient as well.