1

I am developing a product search platform. I try to show the most appropriate product first based on string matching as I have no other means of identifying what user has searched for. However, one major problem is in a query like this.

User Query :: Samsung Galaxy S3

Database Values :: Samsung Galaxy sIII, Samsung Galaxy S III, Samsung Galaxy s3

As we can see, only 1 of the above products is what user will get. Also, if I remove s3 from users query, we will have thousands of irrelevant phones(Entire Samsung galaxy series) visible to the user.

So, I have to filter out the rest. Is there any way, I can efficiently convert roman numbers to numerals. I am using Javascript for string matching. Can this be done by reg exp ? If so, please guide me in that. I have never used it.

Please note solving this problem involves at first identifying the roman number and then converting it to corresponding numerical value. Ex- In case 1 , we have to split out III from sIII and then convert it to 3

Any method or way to solve this will be appreciated.

Thanks !

4

0 回答 0