improve English subtypes refs finder, add tests#1155
Open
goose-life wants to merge 1 commit intomasterfrom
Open
improve English subtypes refs finder, add tests#1155goose-life wants to merge 1 commit intomasterfrom
goose-life wants to merge 1 commit intomasterfrom
Conversation
| self.subtypes_string = '|'.join([re.escape(s) for s in self.subtype_names + self.subtype_abbreviations]) | ||
| self.full_subtypes = Subtype.objects.all() | ||
| self.subtypes = [s.name for s in self.full_subtypes] + \ | ||
| [s.abbreviation for s in self.full_subtypes] |
Contributor
There was a problem hiding this comment.
Given what we've learnt from term matching and italics, does it make sense to sort these longest first?
| (?P<num>\d+) | ||
| (\s+of\s+|/) | ||
| (?P<year>\d{{4}}) | ||
| .{{0,60}}(\s|/) |
Contributor
There was a problem hiding this comment.
This makes me a bit nervous, it's pretty broad.
Contributor
There was a problem hiding this comment.
Neil had an interesting idea which maybe we need to start exploring: start with a broad regex, and then filter down edge cases with supplemental regexes. His argument is it helps to keep the regexes simple and understandable.
Contributor
There was a problem hiding this comment.
eg. this would be a false positive: as published in GN No 102. In section 4378 of the Act...
This stuff is tricky.
| <paragraph eId="sec_1.paragraph-0"> | ||
| <content> | ||
| <p>Something to do with <ref href="/akn/za/act/gn/2012/102">GN no 102 published on 5 March 2012</ref>.</p> | ||
| <p>And another thing about <ref href="/akn/za/act/si/1998/4">SI 4, published in Government Gazette 12345 of 31 January 1998</ref>.</p> |
Contributor
There was a problem hiding this comment.
Maybe this should only markup the GN no 102 and SI 4?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.