RAP Scanner


Turn a scanned California RAP sheet into structured, source-traceable conviction data.

Overview


A California Department of Justice RAP sheet is a confidential criminal history report that documents a person's arrests, charges, court dispositions, sentencing details, and fingerprint events. RAP Scanner reads these dense, inconsistently formatted PDFs and handles the slow, error-prone work a clean slate attorney would otherwise do by hand: extracting each conviction, charge, disposition, and sentence to create a structured timeline and case file.

RAP sheets are printed in a terse, teletype-era format, arrive as scans of variable quality, and layer later court and custody events over earlier ones. RAP Scanner reads them deterministically, using more than 800 explicit, inspectable rules. The same input produces the same result, and every value can be traced to the line that produced it.

Central California Legal Services partnership

RAP sheet review takes a tenth of the time

By hand Review and transcribe the data
60 min
With RAP Scanner 1 min scan + 5 min attorney review
6 min

Average times per RAP sheet, based on attorney reports from the partnership.

The Pipeline


Four phases take a scanned PDF to a structured record. Phase 1 is OCR; phases 2 to 4 run on explicit rules.

  1. 1

    Text extraction

    AWS Textract converts the PDF to text and preserves the page structure.

  2. 2

    Parse

    The parser turns the OCR text into structured rows, one per charge or event, while preserving the wording on the sheet.

  3. 3

    Interpret each row

    Rules separate statute codes, identify courts and counties, and read custody and probation terms from the sentence text.

  4. 4

    Connect the record

    Rules link later court actions to earlier convictions, merge duplicate case entries, trace probation history, and identify dismissed counts.

  5. Send to review

    The cases populate the client's Clean Slate Engine profile, with an annotated RAP sheet and a plain-language summary.

The Parser


The parser works through the OCR text from top to bottom. It recognizes the recurring labels and sections used on California RAP sheets, then copies the relevant text into about 23 defined fields per charge. Parsing runs locally after OCR and uses the same ordered rules each time.

Structure

Names and aliases

The subject's legal name and aliases appear at the top of the record. The parser groups them so later entries can be tied to the same person.

Court and custody blocks

Each COURT: or CUSTODY: block records an event cycle with a date, location, and case number. Prison and juvenile custody entries are kept distinct.

Counts and later events

Each CNT: marks a charge. Later dated lines may record a dismissal, reduction, probation revocation, or sentence change. The parser links those events to the count they affect.

Steps

The parser cleans common OCR noise, reads the name and alias lines, splits the record into court and custody blocks, reads each block's date, location, and case number, and then extracts its counts and later events. It keeps convictions, relief, wardships, and limited contextual entries while excluding arrest-only and administrative material. Each retained count or event becomes its own row.

Example

This illustrative court block shows how a conviction moves from OCR text to transcription and then interpretation. It does not depict a real person.

Conviction Dismissed Custody sentence
Raw OCR textWhat the sheet says
COURT :
NAM: : 002
20040907 CASC MCEL CAJON
CNT 001
#C243209DV
273.5 (A) PC-INFLICT
  CORPORAL INJ:SPOUSE
DISPO: DISMISSED
CNT 002
SEE COMMENT FOR CHARGE
TOC:N
*DISPO: CONVICTED
CONV STATUS : MISDEMEANOR
SEN: 003 YEARS PROB,
  020 DAYS JAIL, FINE
COM: CNT 02 CHRG-242
  (A) (1) PC
DCN T6011582980437000
Parsed rowPhase 2: transcription
group_type        COURT
block_type        count
case_number       C243209DV
date              9/7/04
location          CASC MCEL CAJON
count_no          002
section_desc      SEE COMMENT FOR CHARGE
disposition       CONVICTED
conviction_type   MISDEMEANOR
sentence          003 YEARS PROB,
                  020 DAYS JAIL, FINE
comment           CNT 02 CHRG-242
                  (A) (1) PC
InterpretedPhases 3 and 4
county_1             San Diego
courthouse_1         El Cajon
conviction_date_iso  2004-09-07
code_1               PC
section_1            242 (A)(1)
description_1        BATTERY
conviction_type_1    MISDEMEANOR
custody_period_1     20 days jail
probation_granted    Yes, 3 years

What changed. Count 001 was dismissed, so it is excluded from the conviction output. Count 002 says only "SEE COMMENT FOR CHARGE." Phase 2 preserves that wording and the related comment. Later rules identify 242 (A)(1) PC from the comment, map MCEL CAJON to the El Cajon courthouse, and read three years of probation and 20 days in jail from the sentence. Each change is recorded with its rule and source.

Field Rules


Each field has its own rules, based on patterns found across California RAP sheets. The rules account for common OCR errors while preserving the source text for review.

Dates

Eight-digit date strings are cleaned and converted into standard dates. The original text remains available for comparison.

20180822 → 8/22/18 "20.20.0115" → 20200115 → 1/15/20

Statute citations

A charge is separated into its section, code, and description. Joined statutes stay together, and qualifiers such as ATTEMPTED are preserved.

484/488 PC-THEFT/PETTY THEFT → section 484/488, code PC description THEFT/PETTY THEFT

Dispositions

The rules recognize about 50 disposition terms, including common OCR versions of words such as "convicted." These terms determine which counts represent convictions, dismissals, or relief.

CONVICTED, CONVICK, CONYICT, C0NVICT → treated as a conviction

Custody and sentence

Sentence text is split into prison, jail, probation, and fine terms, with the duration of each stored separately.

"036 MO PROB, 020 DAYS JAIL" → probation 36 months, jail 20 days

Case numbers

Spaces, dashes, and leading symbols are removed for matching. The rules also account for common OCR substitutions when the same case appears elsewhere.

"# C 24-3209 DV" → C243209DV

Courts and counties

The location text is compared with a maintained directory of California courts and common OCR variations, then mapped to a courthouse and county.

CAST / CASP / CASV → CASC "MCEL CAJON" → El Cajon, San Diego County

Complex Records


The most difficult records contain related events separated by years, pages, or OCR errors. The rules connect those entries and preserve the current status of each conviction.

Later court actions

A later entry may revoke probation, change a sentence, dismiss a conviction, or reduce a felony. The scanner links that entry to the affected count and updates the final case history.

Dismissals and reductions

The scanner recognizes set-asides and dismissals under statutes such as Penal Code 1203.4, as well as reductions under Proposition 47, Proposition 64, and Penal Code 17(b). It records the legal basis when the sheet provides enough information to identify it.

Multiple counts and repeated cases

Each count remains separate. When a case appears in more than one block, the scanner combines the entries into the most complete record while preserving count-level details. Sentencing enhancements are separated from the underlying charge.

OCR errors and wrapped text

The scanner repairs recognized OCR errors, rejoins wrapped charge and comment lines, and removes form text that has been attached to a case entry.

Maintained reference tables

Court names, statute information, sentencing enhancements, and wobbler status live in reviewable reference tables. They are updated as the law and court practices change.

Traceability. Every row has a permanent ID. Each interpreted value is stored with the rule and source text that produced it. A reviewer can trace a final value from the case file to the rule, the source line, and the page of the RAP sheet.

Outputs


RAP Scanner is built into the Clean Slate Engine. Extracted convictions load onto the client's profile, where a reviewer can edit any field. The scanner also produces two documents for each RAP sheet.

RAP Sheet: Annotated

The original RAP sheet with every extracted entry highlighted by type: conviction, later dismissed, later reduced, or custody. Hovering over a highlight shows what the scanner extracted, and any conviction left unhighlighted was missed. Numbered red flags mark items that need a second look, and a cover sheet indexes every case and flag.

RAP Sheet: Summary

A plain-language account of the record. It opens with the counts and a one-sentence overview, then lists each case with a conviction from oldest to newest: court, charges, sentence, and any later dismissal or reduction. Juvenile cases, deferred judgment, and diversion are labeled as not convictions.

Privacy. Uploaded RAP sheets and everything produced from them are covered by the Clean Slate Engine's security controls, including encryption and per-organization data isolation.

Verification


Accuracy is checked and improved in three ways.

Regression checks

A fixed set of reference sheets is run again after code changes. Unexpected differences are flagged for review. When a rule change is intentional, the expected results are updated and documented.

Automated tests

More than 800 tests cover parsing and post-processing. They run without cloud services or API keys, so the rule-based behavior can be checked independently.

Continuous improvement

The scanner's rules are updated continually based on feedback from users and testing on new RAP sheets.

The rules, source links, regression checks, automated tests, and attorney review make each result verifiable before use.

Illustrative examples do not depict real people or records. RAP Scanner structures RAP-sheet data. Eligibility is determined separately and reviewed by an attorney before filing.

Learn about the Clean Slate Engine