<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Fuzzy string match in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Fuzzy-string-match/m-p/263742#M51487</link>
    <description>&lt;P&gt;In the Recode pane, there is an option to group strings that allows fuzzy matching.&lt;/P&gt;&lt;P&gt;Is there a JSL function for doing fuzzy string matching? If there is, I'm having trouble finding it. Help!&lt;/P&gt;&lt;P&gt;John&lt;/P&gt;</description>
    <pubDate>Sat, 02 May 2020 19:44:54 GMT</pubDate>
    <dc:creator>john_madden</dc:creator>
    <dc:date>2020-05-02T19:44:54Z</dc:date>
    <item>
      <title>Fuzzy string match</title>
      <link>https://community.jmp.com/t5/Discussions/Fuzzy-string-match/m-p/263742#M51487</link>
      <description>&lt;P&gt;In the Recode pane, there is an option to group strings that allows fuzzy matching.&lt;/P&gt;&lt;P&gt;Is there a JSL function for doing fuzzy string matching? If there is, I'm having trouble finding it. Help!&lt;/P&gt;&lt;P&gt;John&lt;/P&gt;</description>
      <pubDate>Sat, 02 May 2020 19:44:54 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Fuzzy-string-match/m-p/263742#M51487</guid>
      <dc:creator>john_madden</dc:creator>
      <dc:date>2020-05-02T19:44:54Z</dc:date>
    </item>
    <item>
      <title>Re: Fuzzy string match</title>
      <link>https://community.jmp.com/t5/Discussions/Fuzzy-string-match/m-p/263755#M51489</link>
      <description>&lt;P&gt;You might be able to use&amp;nbsp;&lt;EM&gt;Shortest Edit Script&lt;/EM&gt; to make one. The example in the scripting index assembles a string of the characters the two strings share in order.&lt;/P&gt;</description>
      <pubDate>Sat, 02 May 2020 22:00:50 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Fuzzy-string-match/m-p/263755#M51489</guid>
      <dc:creator>Craige_Hales</dc:creator>
      <dc:date>2020-05-02T22:00:50Z</dc:date>
    </item>
    <item>
      <title>Re: Fuzzy string match</title>
      <link>https://community.jmp.com/t5/Discussions/Fuzzy-string-match/m-p/264591#M51582</link>
      <description>&lt;P&gt;Just in follow-up, I ran across a Python open package that provides all kind of string similarity measures. It seems to be really well-done. It's at:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://github.com/luozhouyang/python-string-similarity#damerau-levenshtein" target="_blank" rel="noopener"&gt;https://github.com/luozhouyang/python-string-similarity&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It was straightforward to write a little JSL function that wraps one of the Python functions in this package, e.g., I decided to use the Jaro-Winkler algorithm as implemented there. My function looks like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;JaroWinkler = Function( {str1, str2},
	{arg, rslt},
	arg = Eval Insert(
		"\[
from strsimpy.jaro_winkler import JaroWinkler;
jarowinkler = JaroWinkler();
rslt = jarowinkler.similarity('^str1^', '^str2^')
]\"
	);
	Python Init();
	Python Submit( arg );
	rslt = Python Get( rslt );
	Python Term();
	rslt;
);
&lt;BR /&gt;&lt;BR /&gt;
rslt = JaroWinkler( "My string", "My tsring" );
Show( rslt );  // Log displays the following: rslt&amp;nbsp;=&amp;nbsp;0.974074074074074;&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;(I'm using Python 3.8 on Mac. strsimpy does have a dependence on numpy, which must be installed in your Python.)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 05 May 2020 21:54:12 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Fuzzy-string-match/m-p/264591#M51582</guid>
      <dc:creator>john_madden</dc:creator>
      <dc:date>2020-05-05T21:54:12Z</dc:date>
    </item>
    <item>
      <title>Re: Fuzzy string match</title>
      <link>https://community.jmp.com/t5/Discussions/Fuzzy-string-match/m-p/264779#M51592</link>
      <description>&lt;P&gt;Because Python's string delimiter is a single-quote character (cf. JSL double-quote), it needs to be escaped. You should also put the following two lines at the beginning of the function:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Substitute Into(str1, "'", "\'");
Substitute Into(str2, "'", "\'");&lt;/CODE&gt;&amp;nbsp;&lt;/PRE&gt;</description>
      <pubDate>Wed, 06 May 2020 17:53:21 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Fuzzy-string-match/m-p/264779#M51592</guid>
      <dc:creator>john_madden</dc:creator>
      <dc:date>2020-05-06T17:53:21Z</dc:date>
    </item>
  </channel>
</rss>

