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

Provision refs resolver #1832

Merged
merged 49 commits into from
Nov 1, 2023
Merged

Provision refs resolver #1832

merged 49 commits into from
Nov 1, 2023

Conversation

longhotsummer
Copy link
Contributor

@longhotsummer longhotsummer commented Sep 13, 2023

Replace the old internal refs resolver with a more robust provision refs resolver that can also resolve provisions in external works.

The bulk of the tests were copied over from the old resolver, especially the edge cases. We now can resolve a lot more of these than before.

A single resolver supports multiple languages, currently English and Afrikaans. Adding new languages should hopefully be relatively simple.

https://www.loom.com/share/730117beb7c048e1b857c1914ee1952e

https://www.loom.com/share/12ac35fd26ab4c07aeb850252f6f1620

Outstanding

  • 'subsection (1)(a) of section 27'

@longhotsummer
Copy link
Contributor Author

'paragraph' vs subsection mark-up (some missed)

Do you think it's safe to make something like 'paragraph (16)' look for paragraph, subsection and subparagraph elements? And probably equivalently for subsection and subparagraph.

@longhotsummer
Copy link
Contributor Author

'sub-section', 'section one' passed over

I fixed sub-section but not section one.

@goose-life
Copy link
Contributor

'paragraph' vs subsection mark-up (some missed)

Do you think it's safe to make something like 'paragraph (16)' look for paragraph, subsection and subparagraph elements? And probably equivalently for subsection and subparagraph.

I want to say yes? Especially since you seem to have solved the other issues around where to look first, and finding the 'of section 2(3)' matches before their preceding 'paragraph (a)'.

I suppose it does open us up to potentially more false matches, but if it's a question of just adding more elements to look for I think we can try it out and see? (rather than a big rewrite)

Here are my suggestions from my test drive:

  • 'paragraph' – look for paragraph, subparagraph, subsection (in that order of preference, if that's a thing)
  • 'subparagraph' – look for subparagraph, paragraph
  • 'regulation' – look for section
  • 'subregulation' – look for subsection, paragraph, subparagraph

longhotsummer and others added 3 commits October 17, 2023 08:54
Co-authored-by: edith <32566441+goose-life@users.noreply.github.com>
Co-authored-by: edith <32566441+goose-life@users.noreply.github.com>
@longhotsummer
Copy link
Contributor Author

Support for synonyms, regulations and sub-regulations added.

<subsection eId="sec_1__subsec_4">
<num>(4)</num>
<content>
<p>Referring to section <ref href="/akn/za/act/2009/1/~sec_26__subsec_a">26(a)</ref> of <term refersTo="#term-the_Act">the Act</term>.</p>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

okay we're getting fancy!

@longhotsummer
Copy link
Contributor Author

image

@longhotsummer
Copy link
Contributor Author

The bulk of the raised issues are fixed. I had to disable the Afrikaans translation of 'or'. I don't have a holistic fix currently for indicating to the parser which language it should be working in.

goose-life
goose-life previously approved these changes Oct 30, 2023
Copy link
Contributor

@goose-life goose-life left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

two minor suggestions, happy for you to leave them out (especially tables) if you think it best

longhotsummer and others added 3 commits October 31, 2023 10:01
Co-authored-by: edith <32566441+goose-life@users.noreply.github.com>
Co-authored-by: edith <32566441+goose-life@users.noreply.github.com>
@longhotsummer
Copy link
Contributor Author

@goose-life I've added crossHeading to the list of elements to ignore, too.

@longhotsummer longhotsummer merged commit f509332 into master Nov 1, 2023
6 checks passed
@longhotsummer longhotsummer deleted the refs-resolver branch November 1, 2023 08:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants