-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add multi-sentence title formatting to sentence case and title case (#…
- Loading branch information
Showing
6 changed files
with
137 additions
and
112 deletions.
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