from free text to list of value

205 views Asked by At

I'm implementing a web application with a supscription form (using Java for the backend). In this form there is a field with a dropdown list associated to it. The user has the possibility (with an auto-completion functionality) to select a value from the dropdown list or insert a different value (free text). If the user has entered a value not included in the dropdown list, I would like to verify if the value entered by the user "has the same meaning" to one of the dropdown list in order to standardize it. Is there any method or product that I could leverage on to perform this "data quality" activity? Let me do the following example:

In the dropdown list I've several brands, including LOUIS VITTON. The user doesn't care avout the value "DOLCE & GABBANA" suggested by the auto-completion functionality and insert "dolce and gabbana".

I would like to have a method/tool that understand that "dolce and gabbana" has the same meaning of "DOLCE & GABBANA".

Hope that is clear.

Thank you

Davide

1

There are 1 answers

1
Anil Kesarwani On

Your problem sounds very interesting and practical, I have a simple solution for this problem . First you need to identified word or characters that user can insert to conjugate words , you need to remove them and do similar with your items list and compare the converted (removed extra chars from user input ) with ignoring case with your list items (in which you removed extra chars or words). to explain I am taking your values what you have mention in your requirement. User have entered =>"dolce and gabbana" convetred it as "dolcegabbana" uservalue same time convert your value => DOLCE & GABBANA to "DOLCEGABBANA" yourValue now just compare

yourvalue.equalsIgnoreCase(user's converted value)=true.

to make this thing more practical you need to store your list as map in which key part or your map will be converted string . As given below

ItemMap.put("DOLCEGABBANA","DOLCE & GABBANA")