mysociety/popit-resolver — pull request #2 by osfameron (2014-01-03 17:20:27+00:00)
Title: Improve parsing of parentheses and "Deputy"

a) improve resolution for cases as per
https://github.com/mysociety/za-hansard/issues/25

The HOUSE CHAIRPERSON (Mr C T Frolick) # temporary name
Mnr P J GROENEWALD (VF Plus) # party name inc. spaces

To avoid mis-parsing we only check parens if there are 3 or more
space-separated tokens. We check these first (as they may be overriding
house chairperson for that date, for example).

b) improve resolution of records such as "Deputy Minister for X"

ElasticSearch results seem to be happy to ignore the extraneous word
"Deputy", and though the extra word should lower the score, the closeness
of the date range may be (I'm guessing here?) increasing the score
in some cases. So, if the search term doesn't include "Deputy", we filter the
word out from the results list too.