Package org.wikipediacleaner.api.constants

Examples of org.wikipediacleaner.api.constants.EnumCaseSensitiveness


      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;
        }
View Full Code Here


      while (iter.hasNext()) {
        Element currentNode = (Element) iter.next();
        String title = currentNode.getText();
        String canonical = currentNode.getAttributeValue("canonical");
        String id = currentNode.getAttributeValue("id");
        EnumCaseSensitiveness caseSensitiveness = EnumCaseSensitiveness.getCase(currentNode.getAttributeValue("case"));
        boolean subPages = (currentNode.getAttribute("subpages") != null);
        Namespace ns = new Namespace(id, title, canonical, caseSensitiveness, subPages);
        namespaces.put(ns.getId(), ns);
      }
View Full Code Here

TOP

Related Classes of org.wikipediacleaner.api.constants.EnumCaseSensitiveness

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.