Examples of CheckErrorResult


Examples of org.wikipediacleaner.api.check.CheckErrorResult

    // Reporting error
    if (errors == null) {
      return true;
    }
    PageElementCategory category = categories.get(0);
    CheckErrorResult errorResult = createCheckErrorResult(
        analysis, category.getBeginIndex(), category.getEndIndex());
    String replacement =
        createDefaultSort(analysis) + "\n" +
    analysis.getContents().substring(category.getBeginIndex(), category.getEndIndex());
    errorResult.addReplacement(replacement, GT._("Add DEFAULTSORT"));
    errors.add(errorResult);
    return true;
  }
View Full Code Here

Examples of org.wikipediacleaner.api.check.CheckErrorResult

      }
      if (errors == null) {
        return true;
      }
      result = true;
      CheckErrorResult errorResult = createCheckErrorResult(
          analysis,
          language.getBeginIndex(), language.getEndIndex());
      errorResult.addReplacement(
          "[[:" + contents.substring(language.getBeginIndex() + 2, language.getEndIndex()));
      errors.add(errorResult);
    }

    return result;
View Full Code Here

Examples of org.wikipediacleaner.api.check.CheckErrorResult

        if (punctuationFoundBefore) {
          beginIndex = tmpIndex + 1;
        }

        // Create error
        CheckErrorResult errorResult = createCheckErrorResult(
            analysis, beginIndex, endIndex);
        errorResult.addReplacement(
            allPunctuations + replace,
            allPunctuations + textReplace);
        if (punctuationFoundBefore &&
            !allPunctuations.equals(punctuationBefore)) {
          errorResult.addReplacement(
              punctuationBefore + replace,
              punctuationBefore + textReplace);
        }
        errors.add(errorResult);
      }
View Full Code Here

Examples of org.wikipediacleaner.api.check.CheckErrorResult

      if (errors == null) {
        return true;
      }
      result = true;
      int end = language.getEndIndex();
      CheckErrorResult errorResult = createCheckErrorResult(
          analysis, begin, end);
      errorResult.addReplacement("[[:" + contents.substring(begin + 2, end));
      errors.add(errorResult);
    }

    return result;
  }
View Full Code Here

Examples of org.wikipediacleaner.api.check.CheckErrorResult

      if (!CheckErrorAlgorithms.isAlgorithmActive(wiki, 6)) {
        automatic = false;
      }
    }

    CheckErrorResult errorResult = createCheckErrorResult(
        analysis, beginIndex, endIndex);
    errorResult.addReplacement(replacement, GT._("Add DEFAULTSORT"), automatic);
    errors.add(errorResult);
    return true;
  }
View Full Code Here

Examples of org.wikipediacleaner.api.check.CheckErrorResult

        if (errors == null) {
          return true;
        }
        result = true;
        nameSimple = Page.getStringUcFirst(nameSimple);
        CheckErrorResult errorResult = createCheckErrorResult(
            analysis,
            category.getBeginIndex(), category.getEndIndex());
        if (sortSimple == null) {
          errorResult.addReplacement(
              "[[" + preferredCategory + ":" + nameSimple + "]]");
        } else {
          errorResult.addReplacement(
              "[[" + preferredCategory + ":" + nameSimple + "|" + sortSimple + "]]");
        }
        errors.add(errorResult);
      }
    }
View Full Code Here

Examples of org.wikipediacleaner.api.check.CheckErrorResult

        if (errors == null) {
          return true;
        }
        result = true;
        if (!bTag.isFullTag() && bTag.isComplete()) {
          CheckErrorResult error = createCheckErrorResult(
              analysis,
              bTag.getCompleteBeginIndex(),
              bTag.getCompleteEndIndex());
          String text = analysis.getContents().substring(
              bTag.getValueBeginIndex(),
              bTag.getValueEndIndex());
          if ((text != null) && (text.trim().length() > 0)) {
            String visibleText = text;
            if (text.length() > 30) {
              visibleText = text.substring(0, 10) + "…" + text.substring(text.length() - 10);
            }
            error.addReplacement(
                "'''" + text + "'''",
                GT._("Replace with {0}", "'''" + visibleText + "'''"));
            error.addReplacement(
                text,
                GT._("Replace with {0}", visibleText));
          } else {
            error.addReplacement("", GT._("Delete"));
          }
          errors.add(error);
        } else {
          CheckErrorResult error = createCheckErrorResult(
              analysis, bTag.getBeginIndex(), bTag.getEndIndex());
          error.addReplacement("", GT._("Delete"));
          errors.add(error);
        }
      }
    }
    return result;
View Full Code Here

Examples of org.wikipediacleaner.api.check.CheckErrorResult

      if (lowerCaseNamespace || lowerCaseName) {
        if (errors == null) {
          return true;
        }
        result = true;
        CheckErrorResult errorResult = createCheckErrorResult(
            analysis, category.getBeginIndex(), category.getEndIndex());
        if (categorySort != null) {
          errorResult.addReplacement(
              "[[" + categoryNamespace.getTitle() + ":" + categoryName + "|" + categorySort + "]]");
        } else {
          errorResult.addReplacement(
              "[[" + categoryNamespace.getTitle() + ":" + categoryName + "]]");
        }
        errors.add(errorResult);
      }
    }
View Full Code Here

Examples of org.wikipediacleaner.api.check.CheckErrorResult

          if (!value.equals(replacement.toString())) {
            if (errors == null) {
              return true;
            }
            result = true;
            CheckErrorResult errorResult = createCheckErrorResult(
                analysis,
                defaultSort.getBeginIndex(), defaultSort.getEndIndex());
            errorResult.addReplacement(PageElementFunction.createFunction(
                defaultSort.getFunctionName(),
                replacement.toString()));
            errors.add(errorResult);
          }
        }
View Full Code Here

Examples of org.wikipediacleaner.api.check.CheckErrorResult

          return true;
        }
        result = true;
        int beginIndex = tag.getBeginIndex();
        int endIndex = tag.getEndIndex();
        CheckErrorResult errorResult = createCheckErrorResult(
            analysis, beginIndex, endIndex);
        errors.add(errorResult);
      } else if (tag.isEndTag()) {
        int beginIndex = tag.getBeginIndex();
        int endIndex = tag.getEndIndex();
        if ((contents.charAt(endIndex - 1) == '>') && (contents.charAt(endIndex - 2) == ' ')) {
          if (errors == null) {
            return true;
          }
          result = true;
          CheckErrorResult errorResult = createCheckErrorResult(
              analysis, beginIndex, endIndex, ErrorLevel.WARNING);
          errorResult.addReplacement(
              PageElementTag.createTag(PageElementTag.TAG_WIKI_REF, true, false),
              true);
          errors.add(errorResult);
        }
      }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.