unitedstates/congress — pull request #149 by jonathanstrong (2014-10-24 15:35:13+00:00)
Title: improved House amendment action regex

Improves House amendment action regex in parse_amendment_actions to catch three edge cases.

1. Plural "amendments" (I guess sometimes they vote on the a package of amendments at once. Example: "On agreeing to the Poe amendments (A009) Failed by recorded vote: 141 - 279 (Roll no. 164)."

2. "as modified" instead of "as amended." Example: "On agreeing to the Jackson-Lee (TX) amendment (A015) as modified Agreed to by recorded vote: 233 - 192 (Roll no. 412). (text as modified: CR H6290)"

3. Capital "N" in "Roll No. 129". Example: "On agreeing to the Capps amendment (A028) Failed by recorded vote: 213 - 219 (Roll No. 129)."

added a test_amendment_actions.py file in test folder with tests for these three cases. I'm not sure if that's exactly how you would want it but if nothing else you can look at them to see the fix works.

The regex amendments do not alter the grouping that is used later in the function to assign metadata to the action dict.