mirror of
https://github.com/mitb-archive/filebot
synced 2024-11-16 14:25:02 -05:00
* replace UNICODE_CASE with UNICODE_CLASS which implies UNICODE_CASE and more
This commit is contained in:
parent
75b87edcd7
commit
24dbeda555
@ -213,19 +213,19 @@ public class ReleaseInfo {
|
|||||||
folders.add(it);
|
folders.add(it);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
structureRootFolderPattern = compile(join(folders, "|"), CASE_INSENSITIVE | UNICODE_CASE);
|
structureRootFolderPattern = compile(join(folders, "|"), CASE_INSENSITIVE | UNICODE_CHARACTER_CLASS);
|
||||||
}
|
}
|
||||||
return structureRootFolderPattern;
|
return structureRootFolderPattern;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Pattern getLanguageTagPattern(Collection<String> languages) {
|
public Pattern getLanguageTagPattern(Collection<String> languages) {
|
||||||
// [en]
|
// [en]
|
||||||
return compile("(?<=[-\\[{(])(" + join(quoteAll(languages), "|") + ")(?=\\p{Punct})", CASE_INSENSITIVE | UNICODE_CASE);
|
return compile("(?<=[-\\[{(])(" + join(quoteAll(languages), "|") + ")(?=\\p{Punct})", CASE_INSENSITIVE | UNICODE_CHARACTER_CLASS);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Pattern getLanguageSuffixPattern(Collection<String> languages, boolean strict) {
|
public Pattern getLanguageSuffixPattern(Collection<String> languages, boolean strict) {
|
||||||
// .en.srt
|
// .en.srt
|
||||||
return compile("(?<=[.])(" + join(quoteAll(languages), "|") + ")(?=[._ ]*$)", (strict ? 0 : CASE_INSENSITIVE) | UNICODE_CASE);
|
return compile("(?<=[.])(" + join(quoteAll(languages), "|") + ")(?=[._ ]*$)", (strict ? 0 : CASE_INSENSITIVE) | UNICODE_CHARACTER_CLASS);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Pattern getResolutionPattern() {
|
public Pattern getResolutionPattern() {
|
||||||
@ -253,21 +253,21 @@ public class ReleaseInfo {
|
|||||||
|
|
||||||
public Pattern getReleaseGroupPattern(boolean strict) throws IOException {
|
public Pattern getReleaseGroupPattern(boolean strict) throws IOException {
|
||||||
// pattern matching any release group name enclosed in separators
|
// pattern matching any release group name enclosed in separators
|
||||||
return compile("(?<!\\p{Alnum})(" + join(releaseGroupResource.get(), "|") + ")(?!\\p{Alnum}|[^\\p{Alnum}]\\d{4})", strict ? 0 : CASE_INSENSITIVE | UNICODE_CASE);
|
return compile("(?<!\\p{Alnum})(" + join(releaseGroupResource.get(), "|") + ")(?!\\p{Alnum}|[^\\p{Alnum}]\\d{4})", strict ? 0 : CASE_INSENSITIVE | UNICODE_CHARACTER_CLASS);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Pattern getBlacklistPattern() throws IOException {
|
public Pattern getBlacklistPattern() throws IOException {
|
||||||
// pattern matching any release group name enclosed in separators
|
// pattern matching any release group name enclosed in separators
|
||||||
return compile("(?<!\\p{Alnum})(" + join(queryBlacklistResource.get(), "|") + ")(?!\\p{Alnum})", CASE_INSENSITIVE | UNICODE_CASE);
|
return compile("(?<!\\p{Alnum})(" + join(queryBlacklistResource.get(), "|") + ")(?!\\p{Alnum})", CASE_INSENSITIVE | UNICODE_CHARACTER_CLASS);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Pattern getExcludePattern() throws IOException {
|
public Pattern getExcludePattern() throws IOException {
|
||||||
// pattern matching any release group name enclosed in separators
|
// pattern matching any release group name enclosed in separators
|
||||||
return compile(join(excludeBlacklistResource.get(), "|"), CASE_INSENSITIVE | UNICODE_CASE);
|
return compile(join(excludeBlacklistResource.get(), "|"), CASE_INSENSITIVE | UNICODE_CHARACTER_CLASS);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Pattern getCustomRemovePattern(Collection<String> terms) throws IOException {
|
public Pattern getCustomRemovePattern(Collection<String> terms) throws IOException {
|
||||||
return compile("(?<!\\p{Alnum})(" + join(quoteAll(terms), "|") + ")(?!\\p{Alnum})", CASE_INSENSITIVE | UNICODE_CASE);
|
return compile("(?<!\\p{Alnum})(" + join(quoteAll(terms), "|") + ")(?!\\p{Alnum})", CASE_INSENSITIVE | UNICODE_CHARACTER_CLASS);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Movie[] getMovieList() throws IOException {
|
public Movie[] getMovieList() throws IOException {
|
||||||
@ -290,7 +290,7 @@ public class ReleaseInfo {
|
|||||||
for (String line : seriesDirectMappingsResource.get()) {
|
for (String line : seriesDirectMappingsResource.get()) {
|
||||||
String[] tsv = line.split("\t", 2);
|
String[] tsv = line.split("\t", 2);
|
||||||
if (tsv.length == 2) {
|
if (tsv.length == 2) {
|
||||||
mappings.put(compile("(?<!\\p{Alnum})(" + tsv[0] + ")(?!\\p{Alnum})", CASE_INSENSITIVE | UNICODE_CASE), tsv[1]);
|
mappings.put(compile("(?<!\\p{Alnum})(" + tsv[0] + ")(?!\\p{Alnum})", CASE_INSENSITIVE | UNICODE_CHARACTER_CLASS), tsv[1]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
seriesDirectMappings = unmodifiableMap(mappings);
|
seriesDirectMappings = unmodifiableMap(mappings);
|
||||||
|
@ -149,7 +149,7 @@ public class SeasonEpisodeMatcher {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// season folder pattern for complementing partial sxe info from filename
|
// season folder pattern for complementing partial sxe info from filename
|
||||||
seasonPattern = compile("Season[-._ ]?(\\d{1,2})", CASE_INSENSITIVE | UNICODE_CASE);
|
seasonPattern = compile("Season[-._ ]?(\\d{1,2})", CASE_INSENSITIVE | UNICODE_CHARACTER_CLASS);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -99,7 +99,7 @@ public class SeriesNameMatcher {
|
|||||||
whitelist.addAll(deepMatchAll(focus, threshold));
|
whitelist.addAll(deepMatchAll(focus, threshold));
|
||||||
|
|
||||||
// 1. use pattern matching
|
// 1. use pattern matching
|
||||||
seriesNames.addAll(flatMatchAll(names, compile(join(whitelist, "|"), CASE_INSENSITIVE | UNICODE_CASE), threshold, false));
|
seriesNames.addAll(flatMatchAll(names, compile(join(whitelist, "|"), CASE_INSENSITIVE | UNICODE_CHARACTER_CLASS), threshold, false));
|
||||||
|
|
||||||
// 2. use common word sequences
|
// 2. use common word sequences
|
||||||
seriesNames.addAll(whitelist);
|
seriesNames.addAll(whitelist);
|
||||||
|
@ -653,7 +653,7 @@ class HistoryDialog extends JDialog {
|
|||||||
private final Pattern filter;
|
private final Pattern filter;
|
||||||
|
|
||||||
public HistoryFilter(String filter) {
|
public HistoryFilter(String filter) {
|
||||||
this.filter = compile(quote(filter), CASE_INSENSITIVE | UNICODE_CASE | CANON_EQ);
|
this.filter = compile(quote(filter), CASE_INSENSITIVE | UNICODE_CHARACTER_CLASS | CANON_EQ);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -260,7 +260,7 @@ public class SubtitleViewer extends JFrame {
|
|||||||
|
|
||||||
|
|
||||||
public SubtitleFilter(String filter) {
|
public SubtitleFilter(String filter) {
|
||||||
this.filter = compile(quote(filter), CASE_INSENSITIVE | UNICODE_CASE | CANON_EQ);
|
this.filter = compile(quote(filter), CASE_INSENSITIVE | UNICODE_CHARACTER_CLASS | CANON_EQ);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user