-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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 multi-sentence title formatting to sentence case and title case #6872
Merged
koppor
merged 7 commits into
JabRef:master
from
tmrd993:Add-multiple-sentence-title-formatting-to-sentence-case-and-title-case
Oct 3, 2020
Merged
Changes from 6 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
c29cfb1
Add multi-sentence title formatting to sentence case and title case
tmrd993 d2eaf1a
fix checkstyle issues
tmrd993 4a9ff15
refactor sentence case and title case format method, add additional i…
tmrd993 338e03a
refactor titlecase and sentencecase tests
tmrd993 f9f05a9
fix checkstyle issues
tmrd993 856c4a7
fix checkstyle issues
tmrd993 9237d07
remove redundant test cases
tmrd993 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
26 changes: 26 additions & 0 deletions
26
docs/adr/0017-use-regular-expression-to-split-multiple-sentence-titles.md
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# Use regular expression to split multiple-sentence titles | ||
|
||
## Context and Problem Statement | ||
|
||
Some entry titles are composed of multiple sentences, for example: "Whose Music? A Sociology of Musical Language", therefore, it is necessary to first split the title into sentences and process them individually to ensure proper formatting using '[Sentence Case](https://en.wiktionary.org/wiki/sentence_case)' or '[Title Case](https://en.wiktionary.org/wiki/title_case#English)' | ||
|
||
## Considered Options | ||
|
||
* [Regular expression](https://docs.oracle.com/javase/tutorial/essential/regex/) | ||
* [OpenNLP](https://opennlp.apache.org/) | ||
* [ICU4J](http://site.icu-project.org/home) | ||
|
||
## Decision Outcome | ||
|
||
Chosen option: "Regular expression", because we can use Java internal classes (Pattern, Matcher) instead of adding additional dependencies | ||
|
||
### Positive Consequences | ||
|
||
* Less dependencies on third party libraries | ||
* Smaller project size (ICU4J is very large) | ||
* No need for model data (OpenNLP is a machine learning based toolkit and needs a trained model to work properly) | ||
|
||
### Negative Consequences | ||
|
||
* Regular expressions can never cover every case, therefore, splitting may not be accurate for every title | ||
|
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
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.
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.
Is there a reason why these tests are commented out?
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.
They are redundant as I already added them as parameterized tests but I didn't know if I should delete them yet since they contain the descriptions of the tests.
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.
Then just remove them. I think it's clear from the arguments what is tested