-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Merge parsing of bracketed patterns #6989
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, jabref/src/test/java/org/jabref/logic/citationkeypattern/CitationKeyGeneratorTest.java Lines 1067 to 1074 in 4b1b7b4
should fail using the default unwanted characters. jabref/src/main/java/org/jabref/logic/citationkeypattern/CitationKeyGenerator.java Line 28 in 4b1b7b4
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.java
andAbstractCitationKeyPattern
. This PR aims to merge all parsing code intoBracketedPattern.java
to 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 areAbstractCitationKeyPattern
andGlobalCitationKeyPattern
used for, and should they be removed?Why are bothGlobalCitationKeyPattern
andCitationKeyPatternPreferences
needed 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.