<?xml version="1.0" encoding="UTF-8"?>
<patterns type="Common Error">
  <pattern classes="OCR;" name="Letter &quot;I&quot; in a lower case word" description="Replace letter &quot;I&quot; with letter &quot;l&quot; in a lower case word">
    <rule replacement="l" repeat="True" regex="(?&lt;=[a-z])I" flags="DOTALL;MULTILINE;UNICODE;"/>
    <rule replacement="l" repeat="True" regex="(?&lt;=\b[A-Z])I(?=[a-z])" flags="DOTALL;MULTILINE;UNICODE;"/>
    <rule replacement="'ll" repeat="False" regex="'[Il][Il]\b" flags="DOTALL;MULTILINE;UNICODE;"/>
  </pattern>
  <pattern classes="OCR;" name="Letter &quot;l&quot; in an upper case word" description="Replace letter &quot;l&quot; with letter &quot;I&quot; in an upper case word">
    <rule replacement="I" repeat="True" regex="(?&lt;=[A-Z][A-Z])l" flags="DOTALL;MULTILINE;UNICODE;"/>
    <rule replacement="I" repeat="True" regex="l(?=[A-Z])" flags="DOTALL;MULTILINE;UNICODE;"/>
    <rule replacement="I" repeat="True" regex="(?&lt;![a-hj-z]-)\bl\b(?!-[a-hj-z])" flags="DOTALL;MULTILINE;UNICODE;"/>
    <rule replacement="\1I\3" repeat="False" regex="((\s|^)[&quot;'«»]?)l(?!bs)(?!lama)([bcdfghjklmnpqrstvwxz])" flags="DOTALL;MULTILINE;UNICODE;"/>
  </pattern>
  <pattern classes="OCR;" name="Zero in an upper case word" description="Replace zero with letter &quot;O&quot; in an upper case word">
    <rule replacement="O" repeat="True" regex="(?&lt;=[A-Z])0(?!\d)" flags="DOTALL;MULTILINE;UNICODE;"/>
    <rule replacement="O" repeat="True" regex="(?&lt;!\d)0(?=[A-Z])" flags="DOTALL;MULTILINE;UNICODE;"/>
  </pattern>
  <pattern classes="OCR;" name="Spaces around an apostrophe" description="Remove spaces around an apostrophe">
    <rule replacement="\1'\3" repeat="False" regex="(\w)(' +| +')(d|ll|m|re|s|t|ve)\b" flags="DOTALL;MULTILINE;UNICODE;"/>
  </pattern>
  <pattern classes="Human;" name="Okay" description="Convert various two-letter spellings of okay to &quot;OK&quot;">
    <rule replacement="OK" repeat="False" regex="\b(ok|Ok|O\.K\.)\b" flags="DOTALL;MULTILINE;UNICODE;"/>
  </pattern>
</patterns>