Merge pull request #1134 from junkiattan/1029-filtering

Filter out irrelevant categories (to filter out before 2000s when year is in format XXXX) #1029
This commit is contained in:
neslihanturan 2018-02-15 17:05:43 +03:00 committed by GitHub
commit 8a26a09b69
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -298,8 +298,10 @@ public class CategorizationFragment extends CommonsDaggerSupportFragment {
//Check if item contains a 4-digit word anywhere within the string (.* is wildcard)
//And that item does not equal the current year or previous year
//And if it is an irrelevant category such as Media_needing_categories_as_of_16_June_2017(Issue #750)
//Check if the year in the form of XX(X)0s is relevant, i.e. in the 2000s or 2010s as stated in Issue #1029
return ((item.matches(".*(19|20)\\d{2}.*") && !item.contains(yearInString) && !item.contains(prevYearInString))
|| item.matches("(.*)needing(.*)") || item.matches("(.*)taken on(.*)"));
|| item.matches("(.*)needing(.*)") || item.matches("(.*)taken on(.*)")
|| (item.matches(".*0s.*") && !item.matches(".*(200|201)0s.*")));
}
private void updateCategoryCount(CategoryItem item) {