Verified Owner
Top Fields Constructors Methods
org.jabref.logic.integrity

public Class TitleChecker

extends Object
implements ValueChecker
Class Inheritance
All Implemented Interfaces
org.jabref.logic.integrity.ValueChecker
Imports
java.util.Optional, java.util.function.Predicate, java.util.regex.Pattern, org.jabref.logic.l10n.Localization, org.jabref.logic.util.strings.StringUtil, org.jabref.model.database.BibDatabaseContext, org.jspecify.annotations.Nullable

Field Summary

Modifier and TypeField and Description
private final BibDatabaseContext
private static final Pattern
private static final Predicate<String>
private static final Pattern

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public Optional<String>
checkValue(@Nullable String value)

Algorithm:

  • remove everything that is in curly brackets
  • split the title into subtitles based on the delimiters (defined in the local variable DELIMITERS, currently . ! ? ; : [)
  • for each sub title:
  • remove trailing whitespaces
  • ignore first letter as this can always be written in caps
  • check if at least one capital letter is in the subtitle
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

databaseContextback to summary
private final BibDatabaseContext databaseContext
DELIMITERSback to summary
private static final Pattern DELIMITERS
HAS_CAPITAL_LETTERSback to summary
private static final Predicate<String> HAS_CAPITAL_LETTERS
INSIDE_CURLY_BRAKETSback to summary
private static final Pattern INSIDE_CURLY_BRAKETS

Constructor Detail

TitleCheckerback to summary
public TitleChecker(BibDatabaseContext databaseContext)

Method Detail

checkValueback to summary
public Optional<String> checkValue(@Nullable String value)

Algorithm:

  • remove everything that is in curly brackets
  • split the title into subtitles based on the delimiters (defined in the local variable DELIMITERS, currently . ! ? ; : [)
  • for each sub title:
  • remove trailing whitespaces
  • ignore first letter as this can always be written in caps
  • check if at least one capital letter is in the subtitle
Annotations
@Override