Skip to content

Commit

Permalink
Start parsing offense record count
Browse files Browse the repository at this point in the history
  • Loading branch information
georgehelman committed Apr 30, 2023
1 parent cbf6903 commit d278019
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ pip install -e .
Read CIPRS PDF:

```
python ciprs_-eader.py ./cypress-example.pdf
python ciprs_reader.py ./cypress-example.pdf
```

Run Jupyter:
Expand Down
1 change: 1 addition & 0 deletions ciprs_reader/parser/section/offense.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ def clean(self, matches):

def extract(self, matches, report):
record = {
"Count": matches["num"],
"Action": matches["action"],
"Description": matches["desc"],
"Severity": matches["severity"],
Expand Down
1 change: 1 addition & 0 deletions tests/parsers/test_offense.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ def test_offense_record_charged_with_number(report, state):
"""
matches = offense.OffenseRecordRowWithNumber(report, state).match(string)
assert matches is not None, "Regex match failed"
assert matches["count"] == "54"
assert matches["action"] == "CHARGED"
assert matches["desc"] == "SPEEDING(80 mph in a 65 mph zone)"
assert matches["severity"] == "INFRACTION"
Expand Down

0 comments on commit d278019

Please sign in to comment.