Package org.wikipediacleaner.api.data

Examples of org.wikipediacleaner.api.data.PageElementTemplate


            if (contents.charAt(tmpIndex - 1) == '\n') {
              nbCr++;
            }
            tmpIndex--;
          }
          PageElementTemplate template = analysis.isInTemplate(tmpIndex - 1);
          PageElementFunction function = analysis.isInFunction(tmpIndex - 1);
          if ((template != null) && (template.getEndIndex() == tmpIndex)) {
            replacement.append("\n\n");
            beginIndex = tmpIndex;
          } else if ((function != null) && (function.getEndIndex() == tmpIndex)) {
            if (function.getMagicWord().isPossibleAlias(MagicWord.DEFAULT_SORT)) {
              tmpIndex = function.getBeginIndex();
View Full Code Here


          (analysis.isInCategory(currentIndex) != null) ||
          (analysis.isInTag(currentIndex) != null)) {
        shouldCount = false;
      }
      if (shouldCount) {
        PageElementTemplate template = analysis.isInTemplate(currentIndex);
        if ((template != null) && (template.getEndIndex() == currentIndex + 2)) {
          shouldCount = false;
        }
      }
      if (shouldCount) {
        PageElementFunction function = analysis.isInFunction(currentIndex);
View Full Code Here

          (analysis.isInCategory(currentIndex) != null) ||
          (analysis.isInTag(currentIndex) != null)) {
        shouldCount = false;
      }
      if (shouldCount) {
        PageElementTemplate template = analysis.isInTemplate(currentIndex + 2);
        if ((template != null) &&
            ((template.getBeginIndex() == currentIndex) ||
             (template.getBeginIndex() == currentIndex + 1))) {
          shouldCount = false;
        }
      }
      if (shouldCount) {
        PageElementFunction function = analysis.isInFunction(currentIndex + 2);
View Full Code Here

        PageElementTag refTag = analysis.getSurroundingTag(
            PageElementTag.TAG_WIKI_REF, link.getBeginIndex());
        if (link.hasSquare()) {
          hasError = true;
        } else {
          PageElementTemplate template = analysis.isInTemplate(link.getBeginIndex());
          if (template == null) {
            if (refTag != null) {
              hasError = true;
            }
          }
View Full Code Here

            return -1;
          }
        }
      }
      if (contents.charAt(tmpIndex) == '{') {
        PageElementTemplate template = analysis.isInTemplate(tmpIndex);
        if ((template != null) && (template.getBeginIndex() == tmpIndex)) {
          nextIndex = template.getEndIndex();
        } else {
          PageElementFunction function = analysis.isInFunction(tmpIndex);
          if ((function != null) && (function.getBeginIndex() == tmpIndex)) {
            nextIndex = function.getEndIndex();
          }
View Full Code Here

          value = "978" + isbn.getISBN();
          if (PageElementISBN.isValid(value)) {
            addSearchEngines(analysis, errorResult, value);
          }
          if (isbn.isTemplateParameter()) {
            PageElementTemplate template = analysis.isInTemplate(isbn.getBeginIndex());
            addSearchEngines(analysis, errorResult, template);
          }
          errors.add(errorResult);
        }
      }
View Full Code Here

        boolean done = false;

        // Check for templates beginning with '{{{' instead of '{{'
        if (!done &&
            contents.startsWith("{{{", currentIndex)) {
          PageElementTemplate currentTemplate = analysis.isInTemplate(currentIndex);
          PageElementTemplate nextTemplate = analysis.isInTemplate(currentIndex + 1);
          if ((nextTemplate != null) &&
              (currentIndex + 1 == nextTemplate.getBeginIndex()) &&
              ((currentTemplate == null) ||
               (currentTemplate.getBeginIndex() < currentIndex - 1))) {
            result = true;
            done = true;
            if (errors == null) {
View Full Code Here

            if (PageElementISBN.isValid(value)) {
              addSearchEngines(analysis, errorResult, value);
            }
          }
          if (isbn.isTemplateParameter()) {
            PageElementTemplate template = analysis.isInTemplate(isbn.getBeginIndex());
            addSearchEngines(analysis, errorResult, template);
          }
          errors.add(errorResult);
        }
      }
View Full Code Here

            (analysis.isInTag(currentIndex) != null)) {
          shouldCount = false;
        }
      }
      if (shouldCount) {
        PageElementTemplate template = analysis.isInTemplate(currentIndex + 2);
        if ((template != null) && (contents.startsWith("]]", template.getEndIndex()))) {
          shouldCount = false;
        }
      }
      if (shouldCount) {
        if (errors == null) {
View Full Code Here

          result = true;
          CheckErrorResult errorResult = createCheckErrorResult(analysis, isbn, true);
          addHelpNeededTemplates(analysis, errorResult, isbn);
          addHelpNeededComment(analysis, errorResult, isbn);
          if (isbn.isTemplateParameter()) {
            PageElementTemplate template = analysis.isInTemplate(isbn.getBeginIndex());
            addSearchEngines(analysis, errorResult, template);
          }
          errors.add(errorResult);
        }
      }
View Full Code Here

TOP

Related Classes of org.wikipediacleaner.api.data.PageElementTemplate

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.