Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add regulation extractor to legislation parser #7

Open
strum3nt opened this issue Jul 2, 2020 · 0 comments
Open

Add regulation extractor to legislation parser #7

strum3nt opened this issue Jul 2, 2020 · 0 comments

Comments

@strum3nt
Copy link
Member

strum3nt commented Jul 2, 2020

Problem

The current case to legislation parser looks for references to sections of acts. We should also find references to regulations in case law. The same logic from the legislation parser can be applied to look for references to rules of regulations.

Current process

Currently the legislation parser works by pulling a list of all current and repealed legislation from legislation.govt.nz (https://github.com/openlawnz/openlawnz-pipeline/blob/master/ingester/ingester/getDataFile/pcoLegislation.js). It then looks through cases for references to "sections" by looking for particular characters defined in parseLegislationToCases.js https://github.com/openlawnz/openlawnz-pipeline/blob/b69612ee3d417f97752e6bfe03f6a10ac3dde0e9/pdfconverter/pdfconverter/parseLegislation.js#L223
Followed by a number or numbers.

Suggested modifications

  • Modify getLegislation to obtain the list of all current and repealed legislation and regulations. Legislation and regulations must be pulled and stored separately (do not mix legislation and regulations in the same table). Make a new regulations table and casesToRegulations table for relations.
  • Copy parseLegislationToCases and add another separate parser, or modify the existing parser, to parse regulations as well. Line 223 would need to include (or be changed to):

((word === 'r' || word === 'regulation' || word === 'rr' || word === 'regulations' || word ==='rule' || word='rules') &&

@williamparry williamparry transferred this issue from openlawnz/openlawnz-pipeline Oct 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants