I am used to doing exact match checks on a lot of strings within Ruby, but I am wondering if there's a way to make this process more efficient.
For example, I am taking data from one area and comparing it to what's in active record. If www.domain.com
is in one location, but domain.com
is in the other location, the only way I can determine this is by removing www
in one place or adding it in the other place.
Is there a way to be able to smartly determine if two pieces of data are alike?
In the above example, 10 out of 14 (or 71.42%) of the characters are alike, so I think it'd be safe to assume that the two records belong linked since they are just slightly different.
Is there a gem or a way to be able to intelligently make this kind of decision?