Skip to content

Commit

Permalink
Merge pull request #42 from dsummersl/issue-40
Browse files Browse the repository at this point in the history
Support dashes in disposition method #40
  • Loading branch information
copelco authored Jul 23, 2020
2 parents a45b859 + 11c0e7e commit 474384f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion ciprs_reader/parser/section/offense.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ def extract(self, matches, report):

class OffenseDispositionMethod(OffenseSectionParser):

pattern = r"\s*Disposition Method:\s*(?P<value>[\w ]+)"
pattern = r"\s*Disposition Method:\s*(?P<value>[\w\- ]+)"
section = ("Offense Record", "Disposition Method")

def set_state(self, state):
Expand Down
4 changes: 2 additions & 2 deletions tests/parsers/test_offense.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,10 @@ def test_offense_disposed_date(expected, val, report, state):


def test_known_offense_disposition_method(report, state):
string = " Disposition Method: DISPOSED BY JUDGE"
string = " Disposition Method: WAIVER - MAGISTRATE"
matches = offense.OffenseDispositionMethod(report, state).match(string)
assert matches is not None, "Regex match failed"
assert matches["value"] == "DISPOSED BY JUDGE"
assert matches["value"] == "WAIVER - MAGISTRATE"


def test_plea(report, state):
Expand Down

0 comments on commit 474384f

Please sign in to comment.