cfpb/regulations-parser — pull request #155 by theresaanna (2013-12-30 21:32:09+00:00)
Title: defined term positioning shouldn't reflect xml tags

I identified three possible solutions to this.

1) Figure out if pyparsing's transformString() would make sense. I looked around a little and it doesn't seem like it is meant for what I was hoping to do - evaluate the string before stripping tags - so I dropped it.
2) Somehow surface the length of the suppressed E tag in the layer so that the value could be subtracted from each index in the match. This seems like the most foolproof solution, but I'm not sure how that would work without creating something rather messy.

Implemented version:
3) Get the position of the term in n.text and replace the position tuple in the match object to reflect the position in n.text. One drawback here is that its always going to find the first instance of the term. With the current grammar rules this is ok, but there's a chance that it would be problematic in the future.