mirror of
https://github.com/mitb-archive/filebot
synced 2024-11-10 11:25:04 -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);
|
||||
}
|
||||
}
|
||||
structureRootFolderPattern = compile(join(folders, "|"), CASE_INSENSITIVE | UNICODE_CASE);
|
||||
structureRootFolderPattern = compile(join(folders, "|"), CASE_INSENSITIVE | UNICODE_CHARACTER_CLASS);
|
||||
}
|
||||
return structureRootFolderPattern;
|
||||
}
|
||||
|
||||
public Pattern getLanguageTagPattern(Collection<String> languages) {
|
||||
// [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) {
|
||||
// .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() {
|
||||
@ -253,21 +253,21 @@ public class ReleaseInfo {
|
||||
|
||||
public Pattern getReleaseGroupPattern(boolean strict) throws IOException {
|
||||
// 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 {
|
||||
// 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 {
|
||||
// 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 {
|
||||
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 {
|
||||
@ -290,7 +290,7 @@ public class ReleaseInfo {
|
||||
for (String line : seriesDirectMappingsResource.get()) {
|
||||
String[] tsv = line.split("\t", 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);
|
||||
|
@ -149,7 +149,7 @@ public class SeasonEpisodeMatcher {
|
||||
}
|
||||
|
||||
// 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));
|
||||
|
||||
// 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
|
||||
seriesNames.addAll(whitelist);
|
||||
|
@ -653,7 +653,7 @@ class HistoryDialog extends JDialog {
|
||||
private final Pattern 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
|
||||
|
@ -260,7 +260,7 @@ public class SubtitleViewer extends JFrame {
|
||||
|
||||
|
||||
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