Merge parsing of bracketed patterns#6989
Conversation
|
I think I need an opinion on the cleaning of "unwanted characters". In #4770 the argument were that citation patterns containing special characters ( In particular, I believe this test case, should fail using the default unwanted characters. Is this reasonable? Should I open a separate PR with more information on this issue? (the answer dictates where the |
Extracts code from `generateKey` as methods for readability purposes and switches out the parsing code for the one in `BracketedPattern`
|
Regarding the unwanted characters, you are right. The generator should respect the user defined unwanted chars (and of course the illegal ones) |
|
@Siedlerchr I'll change it and add some test cases |
|
I think looking more into |
Siedlerchr
left a comment
There was a problem hiding this comment.
looks good to me, just one minor thing where I am not sure
* upstream/master: Jstor Fetcher (#6992) Group: "Searching for keywords" searches for a single keyword ==> use singular (#6995) Merge parsing of bracketed patterns (#6989) 6848 fixed the issue of clicking collapse all expanding tree (#6993) Enable auto sync per default for Open/Libre Office (#6985) Bump unirest-java from 3.11.00 to 3.11.01 (#7001) Bump byte-buddy-parent from 1.10.16 to 1.10.17 (#7004) Bump lucene-queryparser from 8.6.2 to 8.6.3 (#7002) Bump postgresql from 42.2.16 to 42.2.17 (#7005) Bump pascalgn/automerge-action from v0.11.0 to v0.12.0 (#7006) Bump flowless from 0.6.1 to 0.6.2 (#7003)
* upstream/master: Update journalList.mv Update to javafx15 (#7018) Squashed 'src/main/resources/csl-styles/' changes from 6fab78b..5297abd try to fix DEP issue with official jdk (#7008) Jstor Fetcher (#6992) Group: "Searching for keywords" searches for a single keyword ==> use singular (#6995) Merge parsing of bracketed patterns (#6989) 6848 fixed the issue of clicking collapse all expanding tree (#6993) Enable auto sync per default for Open/Libre Office (#6985) Bump unirest-java from 3.11.00 to 3.11.01 (#7001) Bump byte-buddy-parent from 1.10.16 to 1.10.17 (#7004) Bump lucene-queryparser from 8.6.2 to 8.6.3 (#7002) Bump postgresql from 42.2.16 to 42.2.17 (#7005) Bump pascalgn/automerge-action from v0.11.0 to v0.12.0 (#7006) Bump flowless from 0.6.1 to 0.6.2 (#7003)
* upstream/master: (58 commits) remove any newlines and spaces in isbn when fetching (#7023) add exception to error handler in integrity check Update journalList.mv Update to javafx15 (#7018) Squashed 'src/main/resources/csl-styles/' changes from 6fab78b..5297abd try to fix DEP issue with official jdk (#7008) Jstor Fetcher (#6992) Group: "Searching for keywords" searches for a single keyword ==> use singular (#6995) Merge parsing of bracketed patterns (#6989) 6848 fixed the issue of clicking collapse all expanding tree (#6993) Enable auto sync per default for Open/Libre Office (#6985) Bump unirest-java from 3.11.00 to 3.11.01 (#7001) Bump byte-buddy-parent from 1.10.16 to 1.10.17 (#7004) Bump lucene-queryparser from 8.6.2 to 8.6.3 (#7002) Bump postgresql from 42.2.16 to 42.2.17 (#7005) Bump pascalgn/automerge-action from v0.11.0 to v0.12.0 (#7006) Bump flowless from 0.6.1 to 0.6.2 (#7003) Rewrite guidelines to Java 15 (#6973) Lint CHANGELOG.md Removing "BibTeX" when not specific to BibTeX (#6983) ...
Fixes #6892.
Character classes (regex expressions in brackets, e.g.,
[a-zA-Z]) should be usable with the regex modifier, but it currently isn't for citation keys.Bracketed patterns are parsed using several different methods in
CitationKeyGenerator.java,BracketedPattern.javaandAbstractCitationKeyPattern. This PR aims to merge all parsing code intoBracketedPattern.javato make it easier to modify bracketed patterns without breaking the citation key generator.Currently BracketedPattern's parser can parse expressions containing the regex modifier using character classes.
Todo
What areAbstractCitationKeyPatternandGlobalCitationKeyPatternused for, and should they be removed?Why are bothGlobalCitationKeyPatternandCitationKeyPatternPreferencesneeded to create aCitationKeyGenerator?Checklist
Change in CHANGELOG.md described (if applicable)Screenshots added in PR description (for UI changes)Checked documentation: Is the information available and up to date? If not created an issue at https://github.com/JabRef/user-documentation/issues or, even better, submitted a pull request to the documentation repository.