Skip to content

Commit

Permalink
Indexing updates
Browse files Browse the repository at this point in the history
- When stripping subtitles from display titles, handle  "the graphic novel" in addition to "a graphic novel" and "graphic novel".
- Do not remove common subtitles from Display Information that has been manually set.
  • Loading branch information
mdnoble73 committed Jun 12, 2024
1 parent 779b3a4 commit e349ff2
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 8 deletions.
Binary file modified code/reindexer/reindexer.jar
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -412,14 +412,14 @@ public void setId(String id) {
}

private final static Pattern removeBracketsPattern = Pattern.compile("\\[.*?]");
private final static Pattern commonSubtitlePattern = Pattern.compile("(?i)([(]?(?:a )?graphic novel|audio cd|book club kit|large print[)]?)$");
private final static Pattern commonSubtitlePattern = Pattern.compile("(?i)([(]?(?:\\s?a\\s?|\\s?the\\s?)?graphic novel|audio cd|book club kit|large print[)]?)$");
private final static Pattern punctuationPattern = Pattern.compile("[.\\\\/()\\[\\]:;]");

void setTitle(String shortTitle, String subTitle, String displayTitle, String sortableTitle, String recordFormat, String formatCategory) {
this.setTitle(shortTitle, subTitle, displayTitle, sortableTitle, formatCategory, false);
}

void setTitle(String shortTitle, String subTitle, String displayTitle, String sortableTitle, String formatCategory, boolean forceUpdate) {
void setTitle(String shortTitle, String subTitle, String displayTitle, String sortableTitle, String formatCategory, boolean isDisplayInfo) {
if (shortTitle != null) {
shortTitle = AspenStringUtils.trimTrailingPunctuation(shortTitle);

Expand Down Expand Up @@ -456,17 +456,19 @@ void setTitle(String shortTitle, String subTitle, String displayTitle, String so
}
}

if (updateTitle || forceUpdate) {
if (updateTitle || isDisplayInfo) {
//Strip out anything in brackets unless that would cause us to show nothing
String tmpTitle = removeBracketsPattern.matcher(shortTitle).replaceAll("").trim();
if (!tmpTitle.isEmpty()) {
shortTitle = tmpTitle;
}
//Remove common formats
tmpTitle = commonSubtitlePattern.matcher(shortTitle).replaceAll("").trim();
if (!tmpTitle.isEmpty()) {
shortTitle = tmpTitle;
}
//Do not remove common subtitle from display info
//if (!isDisplayInfo) {
tmpTitle = commonSubtitlePattern.matcher(shortTitle).replaceAll("").trim();
if (!tmpTitle.isEmpty()) {
shortTitle = tmpTitle;
}
//}
this.title = shortTitle;
this.titleFormat = formatCategory;
//Strip out anything in brackets unless that would cause us to show nothing
Expand Down
4 changes: 4 additions & 0 deletions code/web/release_notes/24.07.00.MD
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@

## Aspen Discovery Updates
// mark
### Indexing Updates
- When stripping subtitles from display titles, handle "the graphic novel" in addition to "a graphic novel" and "graphic novel". (Ticket 132354) (*MDN*)
- Do not remove common subtitles from Display Information that has been manually set. (Ticket 132354) (*MDN*)

### Other Updates
- Show the original translation term when translating text within Aspen. (*MDN*)

Expand Down

0 comments on commit e349ff2

Please sign in to comment.