We have RemoveBracesFormatter, which removes the outer braces. See org.jabref.logic.formatter.bibtexfields.RemoveBracesFormatterTest for examples.
We have org.jabref.model.entry.Author#removeStartAndEndBraces, which also removes inner braces enclosing complete words:
{Vall{\'e}e} {Poussin} -> Vall{\'e}e Poussin <-- here, {Poussin} is changed to Poussin. This is not available to users (in the cleanup entry dialogue)
{Vall{\'e}e Poussin} -> Vall{\'e}e Poussin <-- here, the outer braces are removed
Vall{\'e}e Poussin -> Vall{\'e}e Poussin <-- here, everything is kept as is
We should make this formatter "globally" available:
- Rename
RemoveBracesFormatter to RemoveEnclosingBracesFormatter.
- Also rename all used fields.
- Introduce
RemoveWordEnclosingAndOuterEnclosingBracesFormatter by moving the code of org.jabref.model.entry.Author#removeStartAndEndBraces to here
- Introduce class
- Create test cases (similar to
RemoveBracesFormatterTest)
- Replace call to
removeStartAndEndBraces in Author to call to RemoveWordEnclosingAndOuterEnclosingBracesFormatter.format. The RemoveWordEnclosingAndOuterEnclosingBracesFormatter needs to be initialized as class constant in Author
- Name the formatter
"Remove word enclosing braces"
- Use description
"Removes braces encapsulating a complete word and the complete field content."
- Create a pull request for the user documentation (update the page https://docs.jabref.org/finding-sorting-and-cleaning-entries/saveactions#remove-enclosing-braces).
We have
RemoveBracesFormatter, which removes the outer braces. See org.jabref.logic.formatter.bibtexfields.RemoveBracesFormatterTest for examples.We have
org.jabref.model.entry.Author#removeStartAndEndBraces, which also removes inner braces enclosing complete words:{Vall{\'e}e} {Poussin}->Vall{\'e}e Poussin<-- here,{Poussin}is changed toPoussin. This is not available to users (in the cleanup entry dialogue){Vall{\'e}e Poussin}->Vall{\'e}e Poussin<-- here, the outer braces are removedVall{\'e}e Poussin->Vall{\'e}e Poussin<-- here, everything is kept as isWe should make this formatter "globally" available:
RemoveBracesFormattertoRemoveEnclosingBracesFormatter.RemoveWordEnclosingAndOuterEnclosingBracesFormatterby moving the code oforg.jabref.model.entry.Author#removeStartAndEndBracesto hereRemoveBracesFormatterTest)removeStartAndEndBracesin Author to call toRemoveWordEnclosingAndOuterEnclosingBracesFormatter.format. TheRemoveWordEnclosingAndOuterEnclosingBracesFormatterneeds to be initialized as class constant inAuthor"Remove word enclosing braces""Removes braces encapsulating a complete word and the complete field content."