class_docstr: Replace 'œæ' with AE, 'Œ Æ' with OE.
  Classical Latin wrote the o and e separately (as has today again become the general practice),
  but the ligature was used by medieval and early modern writings, in part because the
  diphthongal sound had, by Late Latin, merged into the sound [e].
  See: https://en.wikipedia.org/wiki/%C5%92
  Æ (minuscule: æ) is a grapheme named æsc or ash, formed from the letters a and e, originally
  a ligature representing the Latin diphthong ae. It has been promoted to the full status of a
  letter in the alphabets of some languages, including Danish, Norwegian, Icelandic, and Faroese.
  See: https://en.wikipedia.org/wiki/%C3%86
  
  >>> replacer = LigatureReplacer()
  >>> replacer.replace("mæd")
  'maed'
  
  >>> replacer.replace("prœil")
  'proeil'
class_docstr_tok: ["Replace","'\u0153\u00e6","'","with","AE",",","'","\u0152","\u00c6","'","with","OE",".","Classical","Latin","wrote","the","o","and","e","separately","(","as","has","today","again","become","the","general","practice",")",",","but","the","ligature","was","used","by","medieval","and","early","modern","writings",",","in","part","because","the","diphthongal","sound","had",",","by","Late","Latin",",","merged","into","the","sound","[","e","]",".","See",":","https",":","\/\/en.wikipedia.org\/wiki\/","%","C5","%","92","\u00c6","(","minuscule",":","\u00e6",")","is","a","grapheme","named","\u00e6sc","or","ash",",","formed","from","the","letters","a","and","e",",","originally","a","ligature","representing","the","Latin","diphthong","ae",".","It","has","been","promoted","to","the","full","status","of","a","letter","in","the","alphabets","of","some","languages",",","including","Danish",",","Norwegian",",","Icelandic",",","and","Faroese",".","See",":","https",":","\/\/en.wikipedia.org\/wiki\/","%","C3","%","86",">",">",">","replacer","=","LigatureReplacer","(",")",">",">",">","replacer.replace","(","``","m\u00e6d","''",")","'maed'",">",">",">","replacer.replace","(","``","pr\u0153il","''",")","'proeil","'"]
docstr: Do character replacement.
docstr_tok: ["Do","character","replacement","."]
code: def replace(self, text):
      """Do character replacement."""
      for pattern, repl in self.patterns:
          text = re.subn(pattern, repl, text)[0]
      return text
  
imports: import re
  from typing import Dict
  from cltk.alphabet.text_normalization import cltk_normalize, remove_odd_punct, split_leading_punct, split_trailing_punct
label_desc: Use image node_id 2 for calling the LigatureReplacer obj's underlying member method code with example usage: obj.replace(text) and returns: text