title: how to implement fast spellchecker in Python with Pandas?
body: <p>I work on text mining problem and need to extract all mentioned of certain keywords. For example, given the list:</p>
  
  <pre><code>list_of_keywords = ['citalopram', 'trazodone', 'aspirin']
  </code></pre>
  
  <p>I need to find all occurrences of the keywords in a text. That could be easily done with Pandas (assuming my text is read in from a csv file):</p>
  
  <p>import pandas as pd</p>
  
  <pre><code>df_text = pd.read_csv('text.csv')
  df_text['matches'] = df_text.str.findall('|'.join(list_of_keywords))
  </code></pre>
  
  <p>However, there are spelling mistakes in the text and some times my keywords will be written as: </p>
  
  <pre><code>'citalopram' as 'cetalopram'
  </code></pre>
  
  <p>or </p>
  
  <pre><code>'trazodone' as 'trazadon'
  </code></pre>
  
  <p>Searching on the web, I found some suggestions how to implement the <a href="http://norvig.com/spell-correct.html" rel="nofollow noreferrer">spell checker</a>, but I am not sure where to insert the spell checker and I reckon that it may slow down the search in the case a very large text.</p>
  
  <p>As another option, it has been suggested to use a wild card with regex and insert in the potential locations of confusion (<strong>conceptually</strong> written)</p>
  
  <pre><code>.findall('c*t*l*pr*m')
  </code></pre>
  
  <p>However I am not convinced that I can capture all possible problematic cases. I tried some out-of-the-box spell checkers, but my texts are some-what specific and I need a spell checker that 'knows' my domain (medical domain).</p>
  
  <p><strong>QUESTION</strong></p>
  
  <p>Is there any efficient way to extract keywords from a text including spelling mistakes?</p>