Closed OscarVanL closed 4 years ago
This PR fixes a mistake separating the charge description and statute from the full charge string in the case there were twos sets of brackets.
For instance, when parsing the text: FELON IN POSSESSION OF AMMUNITION (ACTUAL POSSESSION) (79023)
FELON IN POSSESSION OF AMMUNITION (ACTUAL POSSESSION) (79023)
Before this would be parsed as: description=='FELON IN POSSESSION OF AMMUNITION', statute=='ACTUAL POSSESSION'
description=='FELON IN POSSESSION OF AMMUNITION'
statute=='ACTUAL POSSESSION'
Now this is correctly parsed as: description=='FELON IN POSSESSION OF AMMUNITION (ACTUAL POSSESSION)', statute==' 79023'
description=='FELON IN POSSESSION OF AMMUNITION (ACTUAL POSSESSION)'
statute==' 79023'
It also separates the parsing names into a function to allow for unit testing.
New tests for added test coverage.
Solves some deprecation warnings about the use of escape characters.
This PR fixes a mistake separating the charge description and statute from the full charge string in the case there were twos sets of brackets.
For instance, when parsing the text:
FELON IN POSSESSION OF AMMUNITION (ACTUAL POSSESSION) (79023)
Before this would be parsed as:
description=='FELON IN POSSESSION OF AMMUNITION'
,statute=='ACTUAL POSSESSION'
Now this is correctly parsed as:
description=='FELON IN POSSESSION OF AMMUNITION (ACTUAL POSSESSION)'
,statute==' 79023'
It also separates the parsing names into a function to allow for unit testing.
New tests for added test coverage.
Solves some deprecation warnings about the use of escape characters.