Skip to content

Commit 7bf5882

Browse files
Merge pull request #5673 from c-tonneslan/chore/remove-redundant-case-insensitive-prefixes
Drop redundant (?i) prefixes from utils.actions.Rule patterns
2 parents 7791d20 + 143fb6f commit 7bf5882

8 files changed

Lines changed: 73 additions & 73 deletions

File tree

scrapers/ca/actions.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,15 @@
1010
)
1111
),
1212
Rule(r"^Introduced", "introduction"),
13-
Rule(r"(?i)Referred to (?P<committees>.+)", "referral-committee"),
14-
Rule(r"(?i)Referred to (?P<committees>.+?)(\.\s+suspense)", "referral-committee"),
13+
Rule(r"Referred to (?P<committees>.+)", "referral-committee"),
14+
Rule(r"Referred to (?P<committees>.+?)(\.\s+suspense)", "referral-committee"),
1515
Rule(r"re-refer to Standing (?P<committees>[^.]+)\.", "referral-committee"),
1616
Rule(r"Read first time\.", "reading-1"),
1717
Rule(r"Read second time and amended", ["reading-2"]),
1818
Rule(r"Read third time", "reading-3"),
1919
Rule(r"Read third time. Refused passage\.", "failure"),
2020
Rule(
21-
[r"(?i)read third time.{,5}passed", r"(?i)Read third time.+?Passed"],
21+
[r"read third time.{,5}passed", r"Read third time.+?Passed"],
2222
["passage", "reading-3"],
2323
),
2424
Rule(r"Approved by the Governor", "executive-signature"),
@@ -38,10 +38,10 @@
3838
"failure",
3939
),
4040
Rule(
41-
r"(?i)From committee: ((?!Without further action))((?!Filed with the Chief Clerk pursuant to Joint Rule 56))",
41+
r"From committee: ((?!Without further action))((?!Filed with the Chief Clerk pursuant to Joint Rule 56))",
4242
"committee-passage",
4343
),
44-
Rule(r"(?i)From committee: Do pass", "committee-passage-favorable"),
44+
Rule(r"From committee: Do pass", "committee-passage-favorable"),
4545
Rule(r"From committee with author\'s amendments", "committee-passage"),
4646
# Resolutions
4747
Rule(r"Adopted", "passage"),

scrapers/co/actions.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,8 @@
6262
Rule("Governor Action - Vetoed", "executive-veto"),
6363
Rule(r"^Introduced", "introduction"),
6464
Rule(r"Assigned to (?P<committees>.+)"),
65-
Rule("(?i)refer (un)?amended to (?P<committees>.+)", ["referral-committee"]),
66-
Rule(r"(?i)\S+ Committee on (?P<committees>.+?) Refer (un)amended"),
65+
Rule("refer (un)?amended to (?P<committees>.+)", ["referral-committee"]),
66+
Rule(r"\S+ Committee on (?P<committees>.+?) Refer (un)amended"),
6767
Rule("Assigned to (<?P<committees>.+?)", "referral-committee"),
6868
Rule("Second Reading Passed", ["reading-2"]),
6969
Rule("Third Reading Passed", ["reading-3", "passage"]),

scrapers/de/actions.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,24 +5,24 @@
55
rules = (
66
Rule([r"Amendment (?P<bills>.+?) -\s+Laid On Table"], ["amendment-deferral"]),
77
Rule(["Favorable"], ["committee-passage-favorable"]),
8-
Rule(["(?i)Amendment (?P<bills>.+?) defeated"], ["amendment-failure"]),
9-
Rule(["(?i)introduced and adopted in lieu of (?P<bills>.+)"], ["introduction"]),
8+
Rule(["Amendment (?P<bills>.+?) defeated"], ["amendment-failure"]),
9+
Rule(["introduced and adopted in lieu of (?P<bills>.+)"], ["introduction"]),
1010
Rule(
11-
["(?i)assigned to (?P<committees>.+?) Committee in"],
11+
["assigned to (?P<committees>.+?) Committee in"],
1212
["referral-committee", "introduction"],
1313
),
1414
Rule(["Signed by Governor"], ["executive-signature"]),
15-
Rule([r"(?i)Amendment (?P<bills>[\w\s]+?) Introduced"], ["amendment-introduction"]),
15+
Rule([r"Amendment (?P<bills>[\w\s]+?) Introduced"], ["amendment-introduction"]),
1616
Rule(["Amendment (?P<bills>.+?) - Passed"], ["amendment-passage"]),
17-
Rule(["(?i)^Passed by"], ["passage"]),
17+
Rule(["^Passed by"], ["passage"]),
1818
Rule(["^Defeated"], ["failure"]),
19-
Rule(["(?i)unfavorable"], ["committee-passage-unfavorable"]),
19+
Rule(["unfavorable"], ["committee-passage-unfavorable"]),
2020
Rule([r"Reported Out of Committee \((?P<committees>.+?)\)"], ["committee-passage"]),
2121
Rule(["Vetoed by Governor"], ["executive-veto"]),
2222
Rule(
23-
[r"(?i)Amendment (?P<bills>.+?)\s+-\s+Introduced"], ["amendment-introduction"]
23+
[r"Amendment (?P<bills>.+?)\s+-\s+Introduced"], ["amendment-introduction"]
2424
),
25-
Rule([r"(?i)Amendment (?P<bills>[\w\s]+?) Passed"], ["amendment-passage"]),
25+
Rule([r"Amendment (?P<bills>[\w\s]+?) Passed"], ["amendment-passage"]),
2626
Rule(
2727
[r"Amendment (?P<bills>.+?) - Defeated by House of .+?\. Votes: Defeated"],
2828
["amendment-failure"],

scrapers/ma/actions.py

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@
66
["Amendment #\\S+ \\((?P<legislator>.+?)\\) bundle YES adopted"],
77
["amendment-passage"],
88
),
9-
Rule(["(?i)Signed by (the )Governor(.*)"], ["executive-signature"]),
9+
Rule(["Signed by (the )Governor(.*)"], ["executive-signature"]),
1010
Rule(["Accompanied (by )?(?P<bill_id>[SH]\\S+)"], []),
1111
Rule(["Discharged to the committee on (?P<committees>.+)"], ["referral-committee"]),
12-
Rule(["(?i)Amendment #\\d+ adopted"], ["amendment-passage"]),
12+
Rule(["Amendment #\\d+ adopted"], ["amendment-passage"]),
1313
Rule(
1414
[
1515
"Amendment #\\d+ \\((?P<legislator>.+?)\\) rejected",
16-
"(?i)amendment.+?rejected",
16+
"amendment.+?rejected",
1717
],
1818
["amendment-failure"],
1919
),
@@ -23,16 +23,16 @@
2323
["amendment-introduction"],
2424
),
2525
Rule(["(?P<bill>[HS]\\d+)"], []),
26-
Rule(["(?i)Amendment \\(#\\d+\\) adopted"], ["amendment-passage"]),
27-
Rule(["(?i)with veto"], ["executive-veto"]),
26+
Rule(["Amendment \\(#\\d+\\) adopted"], ["amendment-passage"]),
27+
Rule(["with veto"], ["executive-veto"]),
2828
Rule(["reported favorably by committee"], ["committee-passage-favorable"]),
2929
Rule(["Accompan\\S+ .+?(?P<bill_id>[SH]\\S+)"], []),
30-
Rule(["(?i)Amendment \\d+ pending"], ["amendment-deferral"]),
30+
Rule(["Amendment \\d+ pending"], ["amendment-deferral"]),
3131
Rule(["Read,"], ["reading-1"]),
3232
Rule(
3333
[
34-
"(?i)Amendment #\\S+ \\((?P<legislator>.+?)\\)\\s+-\\s+rejected",
35-
"(?i)Amendment \\d+ rejected",
34+
"Amendment #\\S+ \\((?P<legislator>.+?)\\)\\s+-\\s+rejected",
35+
"Amendment \\d+ rejected",
3636
"Amendment #?\\S+ \\((?P<legislator>.+?)\\) rejected",
3737
],
3838
["amendment-failure"],
@@ -44,7 +44,7 @@
4444
],
4545
["amendment-passage"],
4646
),
47-
Rule(["(?i)read.{,10}second"], ["reading-2"]),
47+
Rule(["read.{,10}second"], ["reading-2"]),
4848
Rule(
4949
["Amendment #\\d+ \\((?P<legislator>.+?)\\) pending"],
5050
["amendment-introduction"],
@@ -58,12 +58,12 @@
5858
[],
5959
),
6060
Rule(["passed over veto"], ["veto-override-passage"]),
61-
Rule(["(?i)Read third"], ["reading-3"]),
61+
Rule(["Read third"], ["reading-3"]),
6262
Rule(["Bill Filed"], ["introduction"]),
63-
Rule(["(?i)Amendment #\\S+ rejected"], ["amendment-failure"]),
63+
Rule(["Amendment #\\S+ rejected"], ["amendment-failure"]),
6464
Rule(["laid aside"], ["amendment-deferral"]),
65-
Rule(["(?i)Amendment \\(#\\d+\\) rejected"], ["amendment-failure"]),
66-
Rule(["(?i)amendment.+?adopted"], ["amendment-passage"]),
65+
Rule(["Amendment \\(#\\d+\\) rejected"], ["amendment-failure"]),
66+
Rule(["amendment.+?adopted"], ["amendment-passage"]),
6767
Rule(["Adopted, (see )?(?P<bill_id>[SH]\\S+)"], []),
6868
Rule(["(?is)Amendment \\(\\d+\\) rejected"], ["amendment-failure"]),
6969
Rule(["(?P<yes_votes>\\d+) YEAS.+?(?P<no_votes>\\d+) NAYS"], []),
@@ -79,30 +79,30 @@
7979
),
8080
Rule(["(?is)Amendment \\(\\d+\\) adopted"], ["amendment-passage"]),
8181
Rule(
82-
["(?i)(Referred|Recommittedra) to (?P<committees>committee on.+)"],
82+
["(Referred|Recommittedra) to (?P<committees>committee on.+)"],
8383
["referral-committee"],
8484
),
8585
Rule(["Accompanied a new draft, (see )?(?P<bill_id>[SH]\\S+)"], []),
8686
Rule(
87-
["(?i)Amendment #\\S+ \\((?P<legislator>.+?)\\) bundle NO rejected"],
87+
["Amendment #\\S+ \\((?P<legislator>.+?)\\) bundle NO rejected"],
8888
["amendment-failure"],
8989
),
9090
Rule(
9191
[
92-
"(?i)(Referred|Recommittedra) to (?P<chamber>\\S+) (?P<committees>committee on.+)"
92+
"(Referred|Recommittedra) to (?P<chamber>\\S+) (?P<committees>committee on.+)"
9393
],
9494
["referral-committee"],
9595
),
9696
Rule(["Committee recommended ought NOT"], ["committee-passage-unfavorable"]),
9797
Rule(
9898
[
99-
"(?i)(Referred|Recommittedra) (to|from)( the)? (?P<chamber>\\S+) "
99+
"(Referred|Recommittedra) (to|from)( the)? (?P<chamber>\\S+) "
100100
"(?P<committees>committee on.+)"
101101
],
102102
["referral-committee"],
103103
),
104-
Rule(["(?i)Amendment #\\d+ rejected"], ["amendment-failure"]),
105-
Rule(["(?i)Amendment \\d+ adopted"], ["amendment-passage"]),
104+
Rule(["Amendment #\\d+ rejected"], ["amendment-failure"]),
105+
Rule(["Amendment \\d+ adopted"], ["amendment-passage"]),
106106
Rule(["Committee of Conference appointed \\((?P<legislator>.+?)\\)"], []),
107107
)
108108

scrapers/me/actions.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,9 @@
3535
"referral-committee",
3636
),
3737
Rule(["READ A SECOND TIME"], ["reading-2"]),
38-
Rule(["(?i)read once"], ["reading-1"]),
39-
Rule("(?i)finally passed", "passage"),
40-
Rule("(?i)passed to be enacted", "passage"),
38+
Rule(["read once"], ["reading-1"]),
39+
Rule("finally passed", "passage"),
40+
Rule("passed to be enacted", "passage"),
4141
Rule(r"COMMITTED to the (?P<committees>Committee on .+?)\.", "referral-committee"),
4242
Rule(r"Sent to the Engrossing Department", "became-law"),
4343
Rule(r"VETO was NOT SUSTAINED", "veto-override-passage"),

scrapers/ok/actions.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,14 @@
1616
r"Remove Senator .+? as principal Senate author "
1717
r"and substitute with Senator (?P<legislators>.+?)"
1818
),
19-
r"(?i)committee substitute (?P<committees>.+)",
20-
r"(?i)remove\s{,10}as\s{,10}author\s{,10}(?P<legislators>.+);",
21-
r"(?i)SCs\s{,10}named\s{,10}(?P<legislators>.+)",
19+
r"committee substitute (?P<committees>.+)",
20+
r"remove\s{,10}as\s{,10}author\s{,10}(?P<legislators>.+);",
21+
r"SCs\s{,10}named\s{,10}(?P<legislators>.+)",
2222
(
2323
r"Pending removal author Senator (?P<legislators>.+?) "
2424
r"and replace with Senator"
2525
),
26-
r"(?i)Representative\(s\)\s{,10}(?P<legislators>.+)",
26+
r"Representative\(s\)\s{,10}(?P<legislators>.+)",
2727
r"Withdrawn from Calendar; (?P<committees>.+)",
2828
(
2929
r"Pending removal author Senator .+? and replace "
@@ -41,7 +41,7 @@
4141
),
4242
r"Pending removal principal author Representative .+? and "
4343
r"replace with Representative (?P<legislators>.+)",
44-
r"(?i)(co)?authored\s{,10}by\s{,10}(?P<legislators>.+)",
44+
r"(co)?authored\s{,10}by\s{,10}(?P<legislators>.+)",
4545
r"Second Reading referred to (?P<committees>.+? Committee)",
4646
r"Notice served to reconsider vote on measure (?P<legislators>.+)",
4747
(
@@ -60,8 +60,8 @@
6060
Rule("Introduced", "introduction"),
6161
Rule(["Adopted"], ["passage"]),
6262
Rule(["HAs rejected"], ["amendment-failure"]),
63-
Rule("(?i)Measure.+?passed", "passage"),
64-
Rule("(?i)Measure.+?passed", "passage"),
63+
Rule("Measure.+?passed", "passage"),
64+
Rule("Measure.+?passed", "passage"),
6565
Rule("Engrossed", "passage"),
6666
Rule("Third Reading, Measure passed", ["passage", "reading-3"]),
6767
Rule(["^Amendment withdrawn"], ["amendment-withdrawal"]),
@@ -89,8 +89,8 @@
8989
["Second Reading referred to .+? then to (?P<committees>.+)"],
9090
["referral-committee", "reading-2"],
9191
),
92-
Rule(["(?i)Placed on Third Reading"], ["reading-3"]),
93-
Rule(["^(?i)Third Reading"], ["reading-3"]),
92+
Rule(["Placed on Third Reading"], ["reading-3"]),
93+
Rule(["^Third Reading"], ["reading-3"]),
9494
Rule(r"committee substitute (?P<committees>.+?);"),
9595
Rule(["Do Pass (as amended )?(?P<committees>.+)"], ["committee-passage"]),
9696
Rule(["Failed in Committee - (?P<committees>.+)"], ["committee-failure"]),
@@ -101,7 +101,7 @@
101101
["Reported Do Pass, amended by committee substitute (?P<committees>.+?);"],
102102
["committee-passage"],
103103
),
104-
Rule(["^(?i)Reported Do Pass"], ["committee-passage"]),
104+
Rule(["^Reported Do Pass"], ["committee-passage"]),
105105
Rule(
106106
["Do pass, amended by committee substitute (?P<committees>)"],
107107
["committee-passage"],

scrapers/wa/actions.py

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -61,51 +61,51 @@
6161
Rule(r"Prefiled for introduction", "filing"),
6262
Rule(r"amendment adopted", "amendment-passage"),
6363
Rule(r"amendment not adopted", "amendment-failure"),
64-
Rule(r"(?i)third reading, (?P<pass_fail>(passed|failed))", "reading-3"),
64+
Rule(r"third reading, (?P<pass_fail>(passed|failed))", "reading-3"),
6565
Rule(r"Read first time", "reading-1"),
66-
Rule(r"(?i)first reading, referred to (?P<committees>.*)\.", "reading-1"),
67-
Rule(r"(?i)And refer to (?P<committees>.*)", "referral-committee"),
68-
Rule(r"(?i).* substitute bill substituted.*", "substitution"),
69-
Rule(r"(?i)chapter (((\d+),?)+) \d+ laws.( .+)?", ""), # XXX: Thom: Code stuff?
70-
Rule(r"(?i)effective date \d{1,2}/\d{1,2}/\d{4}.*", ""),
66+
Rule(r"first reading, referred to (?P<committees>.*)\.", "reading-1"),
67+
Rule(r"And refer to (?P<committees>.*)", "referral-committee"),
68+
Rule(r".* substitute bill substituted.*", "substitution"),
69+
Rule(r"chapter (((\d+),?)+) \d+ laws.( .+)?", ""), # XXX: Thom: Code stuff?
70+
Rule(r"effective date \d{1,2}/\d{1,2}/\d{4}.*", ""),
7171
Rule(
72-
r"(?i)(?P<committees>\w+) - [Mm]ajority; do pass with amendment\(s\) \
72+
r"(?P<committees>\w+) - [Mm]ajority; do pass with amendment\(s\) \
7373
(but without amendments\(s\))?.*\.",
7474
"committee-passage-favorable",
7575
"committee-passage",
7676
),
7777
Rule(
78-
r"(?i)Executive action taken in the (House|Senate) committee on (?P<committees>.*) \
78+
r"Executive action taken in the (House|Senate) committee on (?P<committees>.*) \
7979
(at)? .*\.",
8080
"",
8181
),
8282
Rule(
83-
r"(?i)(?P<committees>\w+) \- [Mm]ajority; do pass .* \(Majority Report\)",
83+
r"(?P<committees>\w+) \- [Mm]ajority; do pass .* \(Majority Report\)",
8484
"committee-passage-favorable",
8585
),
86-
Rule(r"(?i)Conference committee appointed.", ""),
87-
Rule(r"(?i)Conference committee report;", ""),
86+
Rule(r"Conference committee appointed.", ""),
87+
Rule(r"Conference committee report;", ""),
8888
Rule(
89-
r"(?i).+ - Majority; \d+.+ substitute bill be substituted, do pass",
89+
r".+ - Majority; \d+.+ substitute bill be substituted, do pass",
9090
"substitution",
9191
),
9292
Rule(r"President signed", "passage"),
9393
Rule(r"Speaker signed", "passage"),
9494
Rule(
95-
r"(?i)Signed by (?P<signed_chamber>(Representatives|Senators)) (?P<legislators>.*)",
95+
r"Signed by (?P<signed_chamber>(Representatives|Senators)) (?P<legislators>.*)",
9696
"passage",
9797
),
98-
Rule(r"(?i)Referred to (?P<committees>.*)(\.)?"),
98+
Rule(r"Referred to (?P<committees>.*)(\.)?"),
9999
Rule(
100-
r"(?i)(?P<from_committee>.*) relieved of further consideration. On motion, referred to \
100+
r"(?P<from_committee>.*) relieved of further consideration. On motion, referred to \
101101
(?P<committees>.*)",
102102
"referral-committee",
103103
),
104-
Rule(r"(?i)Governor partially vetoed", "executive-veto-line-item"),
105-
Rule(r"(?i)Governor vetoed", "executive-veto"),
106-
Rule(r"(?i)Governor signed", "executive-signature"),
107-
Rule(r"(?i)Passed final passage;", "passage"),
108-
Rule(r"(?i)Failed final passage;", "failure"),
104+
Rule(r"Governor partially vetoed", "executive-veto-line-item"),
105+
Rule(r"Governor vetoed", "executive-veto"),
106+
Rule(r"Governor signed", "executive-signature"),
107+
Rule(r"Passed final passage;", "passage"),
108+
Rule(r"Failed final passage;", "failure"),
109109
Rule(r"Effective date", "became-law"),
110110
Rule(r"Chapter .* Laws", "became-law"),
111111
Rule(r"Minority; do not pass.", "committee-passage-unfavorable"),

scrapers/wv/actions.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@
8585
"To (?P<committees>.+?) then",
8686
]
8787
),
88-
Rule("(?i)voice vote", voice_vote=True),
88+
Rule("voice vote", voice_vote=True),
8989
Rule(["Amendment rejected"], ["amendment-failure"]),
9090
Rule(["To Governor"], ["executive-receipt"]),
9191
Rule(["Passed House"], ["passage"]),
@@ -96,13 +96,13 @@
9696
Rule(["^Introduced"], ["introduction"]),
9797
Rule(["To .+? then (?P<committees>.+)"], []),
9898
Rule(["^Filed for intro"], ["filing"]),
99-
Rule(["(?i)referred to (?P<committees>.+)"], ["referral-committee"]),
99+
Rule(["referred to (?P<committees>.+)"], ["referral-committee"]),
100100
Rule("Senator (?P<legislators>.+? )requests " "to be removed as sponsor of bill"),
101101
Rule(["To House (?P<committees>[A-Z].+)"], ["referral-committee"]),
102102
Rule(["Passed Senate"], ["passage"]),
103-
Rule(["(?i)committed to (?P<committees>.+?) on"], []),
103+
Rule(["committed to (?P<committees>.+?) on"], []),
104104
Rule(["Vetoed by Governor"], ["executive-veto"]),
105-
Rule(["(?i)House concurred in senate amendment"], []),
105+
Rule(["House concurred in senate amendment"], []),
106106
Rule(["Be rejected"], ["failure"]),
107107
Rule(["To .+? then (?P<committees>.+) then", "reading to (?P<committees>.+)"]),
108108
Rule(["Adopted by"], ["passage"]),
@@ -111,8 +111,8 @@
111111
Rule(["Be adopted$"], ["passage"]),
112112
Rule(
113113
[
114-
"(?i)originating in (House|Senate) (?P<committees>.+)",
115-
"(?i)to house (?P<committees>.+)",
114+
"originating in (House|Senate) (?P<committees>.+)",
115+
"to house (?P<committees>.+)",
116116
]
117117
),
118118
Rule(["Read 1st time"], ["reading-1"]),

0 commit comments

Comments
 (0)