Text identification
<p>Let's say I have a list of some strings (movie names in my case) and now I have a new sentence which contains one of the string from the list of strings. How do I find that which string does the sentence has? 
For eg:</p>

<pre><code>list_of_strings = ['20th century women', 'green is gold ', 'fire at sea']
sentence = 'Official Trailer | Green is  gold - Releasing Tomorrow'
</code></pre>

<p>For above case, solution should be able to find that <em>sentence</em> contains <em>green is gold</em>.
Please suggest which algorithm are available to solve this issue. Implementation/Library in Python will also work. </p>

<blockquote>
  <p>Sentences might contain little different spellings.</p>
</blockquote>

<p>List of strings has 10000-15000 strings.</p>

<p>As most of the answers here focus on string search part, I will consider the other interesting part of the problem, i.e. Spell Error. </p>

<p>Spell error case is an interesting and very practical in real data.</p>

<p>To deal with it, you can have a look at following metrics : </p>

<ol>
<li><p><a href="https://en.wikipedia.org/wiki/Levenshtein_distance" rel="nofollow">Levenshtein distance</a> : Its a string metric to measure the similarity between two strings. Its basically the min. number of single character edits(insertion, deletion, replace etc), u can do to transform one string to another.</p>

<p>For ex : </p>

<p><code>"green in gold", "grren in gold" : Distane = 1 // replace r by e</code></p>

<p>Python package : <a href="https://pypi.python.org/pypi/python-Levenshtein/" rel="nofollow">Levenstein Distance</a></p></li>
<li><p><a href="https://en.wikipedia.org/wiki/Soundex" rel="nofollow">Soundex :</a> Generally spelling problems are solved by using some variation of Soundex Algorithm. Soundex is a phonetic algorithm for indexing names by sound, as pronounced in English. The goal is for homophones to be encoded to the same representation so that they can be matched despite minor differences in spelling. (Source Wiki )</p>

<p>For ex : Soundex(Clinton) = Soundex(Clenton)</p>

<p>Python library : <a href="https://pypi.python.org/pypi/Fuzzy" rel="nofollow">Fuzzy</a> </p></li>
</ol>

<p>I hope it helps. </p>

python algorithm text