JustUtahCoders / utahexpungements.org

The frontend code for utahexpungements.org
MIT License
11 stars 19 forks source link

Separate offense name from severity #95

Open joeldenning opened 4 years ago

joeldenning commented 4 years ago

Right now the pdf parser outputs charges that look like this:

    {
      "statute": "76-6-502",
      "description": "POSSESS FORGERY WRITING/DEVICE 3rd Degree Felony",
      "disposition": "Dismissed w/ Prejudi"
    },

We want that to look like this:

    {
      "statute": "76-6-502",
      "offenseName": "POSSESS FORGERY WRITING/DEVICE",
      "severity": " 3rd Degree Felony",
      "disposition": "Dismissed w/ Prejudi"
    },
image
Cuthbert20 commented 4 years ago

I am thinking of splitting @ 1st || 2nd || 3rd || Class. My only concern is if there is an offense name that includes the word "class" in it. I am going try and find a list of offense names and see if there are any that include the word class.

joeldenning commented 4 years ago

I think one implementation approach could be to find the last word that is all caps and then split the string based on that.

Cuthbert20 commented 4 years ago

yeah that's a great idea. Thanks!

tuckersamuelsen commented 4 years ago

I just pulled up a bunch of old court cases, and I have not found any counter examples to the option @joeldenning presented. I think we can safely say that the offense description will ALWAYS be all caps, and the severity will ALWAYS be first letter capitalized, otherwise lowercase.