Compare Strings Return true if 80%of Likely match

Hi all,

I am trying to do the exact scenario as this StackOverflow questions
Compare Strings Javascript Return %of Likely

Can someone point me out how to get started with Uipath for this scenario?

For example
Str1 = “UiPath Bot Process”
Str2 = “UPath bo Proce”

80% Match

Then assign Status=“Normal”
Else “Exception”

@ClaytonM , @lakshman , @Palaniyappan

just tagging to get help. Obviously I would like to get help from anyone :slight_smile:

Thank You :slight_smile:

Hi,

You need to calculate edit distance to achieve it and there is a component for it at UiPath Connect!

Can you try it?

Regards,

2 Likes

@whitestar - i did similar one with a invoke code option with our own code.
1 - Split string to character
2- compares character by character
3 - skip character till the next match
4- do a loop till the last word
5- and calculate the % by hits/count

2 Likes

Thank for it but i want to know how to do rather than using the ready made one.

i tested and it’s not exactly working

For example

String1 = “UiPah,Is,This”
String2 = “This is UiPath”

and i got return with 25% only.
For me it’s 90% match value just not in an order and , added instead of space.

Any other algorithm i can test it out ?

Thanks everyone.

Did you find any solution for this?
I am also searching for the same thing.

Hi @kvbramha,

I ended up using the FuzzyWuzzy python library to do it.

It has been working very well for us :slight_smile:

Let me know if you have questions happy to help.

Did you get solution for this

Yes, you will need to use invoke code to run the python script.

Can you please provide the python code?

@kvbramha

this is the code

from difflib import SequenceMatcher
def simmilarity(a,b):

             return SequenceMatcher(None,a,b).ratio()


a, b are the string u need to compare, it will return the similarity percentage

Regards,
Nived N

3 Likes

how would you go about implementing this