return false;
}
// Case sensitiveness
Namespace namespace = analysis.getWikiConfiguration().getNamespace(Namespace.CATEGORY);
EnumCaseSensitiveness sensitive = EnumCaseSensitiveness.UNKNOWN;
if (namespace != null) {
sensitive = namespace.getCaseSensitiveness();
}
// Group categories by name
List<PageElementCategory> categories = analysis.getCategories();
if ((categories == null) || (categories.isEmpty())) {
return false;
}
Map<String, List<PageElementCategory>> groupedCategories = new HashMap<String, List<PageElementCategory>>();
for (PageElementCategory category : categories) {
String name = sensitive.normalize(category.getName());
List<PageElementCategory> groupCategory = groupedCategories.get(name);
if (groupCategory == null) {
groupCategory = new ArrayList<PageElementCategory>();
groupedCategories.put(name, groupCategory);
}
groupCategory.add(category);
}
// Compute index of last title
List<PageElementTitle> titles = analysis.getTitles();
int lastTitle = 0;
if ((titles != null) && (!titles.isEmpty())) {
lastTitle = titles.get(titles.size() - 1).getEndIndex();
}
// Check each category
boolean result = false;
String contents = analysis.getContents();
for (PageElementCategory category : categories) {
String name = sensitive.normalize(category.getName());
List<PageElementCategory> groupCategory = groupedCategories.get(name);
if ((groupCategory != null) && (groupCategory.size() > 1)) {
if (errors == null) {
return true;
}