<meta http-equiv="content-type" content="text/html; charset=utf-8"><blockquote class="gmail_quote" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex; ">

<span class="Apple-style-span" style="font-family: arial, sans-serif; font-size: 13px; border-collapse: collapse; ">How about running the text thru a spell checker.  Using the gmail<br></span>spell checker the following:<br>

This tirst document is a coniract betweeo<br>was corrected to:<br>This test document is a contract between<br>I just used the first word that gmail suggested.</blockquote><blockquote><blockquote class="gmail_quote" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex; ">

</blockquote></blockquote><blockquote><blockquote class="gmail_quote" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex; ">

</blockquote></blockquote><blockquote><blockquote class="gmail_quote" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex; ">

</blockquote></blockquote><blockquote><blockquote class="gmail_quote" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex; ">

</blockquote></blockquote><div><font class="Apple-style-span" face="arial, sans-serif"><span class="Apple-style-span" style="border-collapse: collapse;"><br></span></font></div><div><font class="Apple-style-span" face="arial, sans-serif"><span class="Apple-style-span" style="border-collapse: collapse;">Is there an API for this? So one could automate the choosing of the first suggested word?</span></font></div>

<div><font class="Apple-style-span" face="arial, sans-serif"><span class="Apple-style-span" style="border-collapse: collapse;"><br clear="all"></span></font>Regards,<br>Sean<br><br><br>
<br><br><div class="gmail_quote">On Thu, Feb 3, 2011 at 8:50 PM,  <span dir="ltr">&lt;<a href="mailto:richard@rushlogistics.com">richard@rushlogistics.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

I think this might be a good idea as character  count and spacing is usually consistent.<br>
<div class="im">Watch our 3 minute movie: <a href="http://www.rushlogistics.com/movie" target="_blank">http://www.rushlogistics.com/movie</a><br>
<br>
</div><div><div></div><div class="h5">-----Original Message-----<br>
From: Michael Potter &lt;<a href="mailto:michael@potter.name">michael@potter.name</a>&gt;<br>
Sender: chicago-talk-bounces+richard=<a href="http://rushlogistics.com" target="_blank">rushlogistics.com</a>@<a href="http://pm.org" target="_blank">pm.org</a><br>
Date: Thu, 3 Feb 2011 20:02:51<br>
To: Chicago.pm chatter&lt;<a href="mailto:chicago-talk@pm.org">chicago-talk@pm.org</a>&gt;<br>
Reply-To: &quot;Chicago.pm chatter&quot; &lt;<a href="mailto:chicago-talk@pm.org">chicago-talk@pm.org</a>&gt;<br>
Subject: Re: [Chicago-talk] Regular expression discussion.<br>
<br>
It would be interesting to know if OCR usually gets word boundaries<br>
and character count in each word correct.  if so you might be able to<br>
leverage that in the search.<br>
<br>
On Thu, Feb 3, 2011 at 12:51 PM, Sean Blanton &lt;<a href="mailto:sean@blanton.com">sean@blanton.com</a>&gt; wrote:<br>
&gt;&gt; String::KeyboardDistance (which can do QWERTY and Dvorak US layouts, and<br>
&gt;&gt; seems most appropriate to what you&#39;re describing);<br>
&gt; You should be able to create your own &quot;keyboard&quot; map, which is actually a<br>
&gt; map of common OCR errors rather than typographical ones. t is near f and i<br>
&gt; is near t, o near n, according to your example.<br>
&gt; Here is an academic article that might help if you have several months to<br>
&gt; spend on this problem:<br>
&gt; <a href="http://archive.nlm.nih.gov/pubs/hauser/Tompaper/tompaper.php" target="_blank">http://archive.nlm.nih.gov/pubs/hauser/Tompaper/tompaper.php</a><br>
&gt; Regards,<br>
&gt; Sean<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; 2011/2/3 Ted Zlatanov &lt;<a href="mailto:tzz@lifelogs.com">tzz@lifelogs.com</a>&gt;<br>
&gt;&gt;<br>
&gt;&gt; On Wed, 02 Feb 2011 08:55:36 -0500 (EST) Richard Reina<br>
&gt;&gt; &lt;<a href="mailto:richard@rushlogistics.com">richard@rushlogistics.com</a>&gt; wrote:<br>
&gt;&gt;<br>
&gt;&gt; RR&gt; Tired of shoveling snow. Well sit right down and lets have a regex<br>
&gt;&gt; RR&gt; discussion. I have a perl script that at the moment just uses grep to<br>
&gt;&gt; RR&gt; look though text files that have been converted from pdf2text to see<br>
&gt;&gt; RR&gt; what sort of documents they are.  What I am finding however is that a<br>
&gt;&gt; RR&gt; lot of searches fail by just a few characters.<br>
&gt;&gt; RR&gt; For example, if I am looking for &quot;This first document is a contract<br>
&gt;&gt; between&quot; the text string in the file might look like this<br>
&gt;&gt; RR&gt; &quot;This tirst document is a coniract betweeo&quot; and the grep search<br>
&gt;&gt; RR&gt; fails. However, as you can see these two statements are 93% alike.  Is<br>
&gt;&gt; RR&gt; there a way with perl regular expressions to match strings that are<br>
&gt;&gt; RR&gt; say 90, 95 or 98% alike?<br>
&gt;&gt;<br>
&gt;&gt; Definitely not with regular expressions.  This is usually called the<br>
&gt;&gt; string distance; I first learned it in the context of Hamming codes but<br>
&gt;&gt; there it&#39;s only used for substitutions.  String distance turns out a lot<br>
&gt;&gt; in bioinformatics as well, so there&#39;s plenty of research out there.<br>
&gt;&gt;<br>
&gt;&gt; I would start with String::Approx as Warren suggested and it&#39;s the one<br>
&gt;&gt; I&#39;ve used, but also see<br>
&gt;&gt;<br>
&gt;&gt; String::KeyboardDistance (which can do QWERTY and Dvorak US layouts, and<br>
&gt;&gt; seems most appropriate to what you&#39;re describing);<br>
&gt;&gt;<br>
&gt;&gt; <a href="http://www.perlmonks.org/?node_id=245428" target="_blank">http://www.perlmonks.org/?node_id=245428</a><br>
&gt;&gt;<br>
&gt;&gt; ... which suggests Text::Levenshtein and String::Trigram as well.<br>
&gt;&gt;<br>
&gt;&gt; Ted<br>
&gt;&gt;_______________________________________________<br>
&gt;&gt; Chicago-talk mailing list<br>
&gt;&gt; <a href="mailto:Chicago-talk@pm.org">Chicago-talk@pm.org</a><br>
&gt;&gt; <a href="http://mail.pm.org/mailman/listinfo/chicago-talk" target="_blank">http://mail.pm.org/mailman/listinfo/chicago-talk</a><br>
&gt;<br>
&gt;<br>
&gt;_______________________________________________<br>
&gt; Chicago-talk mailing list<br>
&gt; <a href="mailto:Chicago-talk@pm.org">Chicago-talk@pm.org</a><br>
&gt; <a href="http://mail.pm.org/mailman/listinfo/chicago-talk" target="_blank">http://mail.pm.org/mailman/listinfo/chicago-talk</a><br>
&gt;<br>
<br>
<br>
<br>
--<br>
Michael Potter<br>
Replatform Technologies, LLC<br>
<a href="tel:+17708156142">+1 770 815 6142</a><br>
<a href="mailto:michael@potter.name">michael@potter.name</a><br>
_______________________________________________<br>
Chicago-talk mailing list<br>
<a href="mailto:Chicago-talk@pm.org">Chicago-talk@pm.org</a><br>
<a href="http://mail.pm.org/mailman/listinfo/chicago-talk" target="_blank">http://mail.pm.org/mailman/listinfo/chicago-talk</a><br>
_______________________________________________<br>
Chicago-talk mailing list<br>
<a href="mailto:Chicago-talk@pm.org">Chicago-talk@pm.org</a><br>
<a href="http://mail.pm.org/mailman/listinfo/chicago-talk" target="_blank">http://mail.pm.org/mailman/listinfo/chicago-talk</a><br>
</div></div></blockquote></div><br></div>