From a118e5ee309d862478f08c65cdf68b642b3252ce Mon Sep 17 00:00:00 2001 From: "Steven R. Loomis" Date: Mon, 3 Jan 2022 14:13:07 -0600 Subject: [PATCH] CLDR-15161 3rd meter: correct error count (#1671) --- .../cldr/web/api/LocaleCompletion.java | 27 ++++++++++++++++--- 1 file changed, 23 insertions(+), 4 deletions(-) diff --git a/tools/cldr-apps/src/main/java/org/unicode/cldr/web/api/LocaleCompletion.java b/tools/cldr-apps/src/main/java/org/unicode/cldr/web/api/LocaleCompletion.java index 7561ea8d3bf..aff7c7158a2 100644 --- a/tools/cldr-apps/src/main/java/org/unicode/cldr/web/api/LocaleCompletion.java +++ b/tools/cldr-apps/src/main/java/org/unicode/cldr/web/api/LocaleCompletion.java @@ -142,25 +142,34 @@ static LocaleCompletionResponse getLocaleCompletion(final CLDRLocale cldrLocale, final List results = new ArrayList<>(); for (final String xpath : file) { + lcr.allXpaths ++; final Level pathLevel = covLeveller.getLevel(xpath); final String fullPath = file.getFullXPath(xpath); final PathHeader ph = LocaleCompletionHelper.INSTANCE.phf.fromPath(xpath); SurveyToolStatus surveyToolStatus = ph.getSurveyToolStatus(); if (surveyToolStatus == SurveyToolStatus.DEPRECATED || surveyToolStatus == SurveyToolStatus.HIDE) { + lcr.ignoredHidden ++; continue; // not visible } - checkCldr.check(fullPath, results, file.getStringValue(xpath)); + checkCldr.check(xpath, results, file.getStringValue(xpath)); - boolean hasError = CheckStatus.hasError(results); + final boolean hasError = CheckStatus.hasError(results); + + final boolean statusMissing = STFactory.calculateStatus(file, baselineFile, xpath) == VoteResolver.Status.missing; + + if (statusMissing) { + lcr.statusMissing ++; + } // TODO: copy and paste from CheckCLDR.getShowRowAction - CLDR-15230 if (CheckCLDR.LIMITED_SUBMISSION && !SubmissionLocales.allowEvenIfLimited( localeId, xpath, hasError, - STFactory.calculateStatus(file, baselineFile, xpath) == VoteResolver.Status.missing)) { + statusMissing)) { + lcr.ignoredLimited ++; continue; // not allowed through by SubmissionLocales. } @@ -178,7 +187,10 @@ static LocaleCompletionResponse getLocaleCompletion(final CLDRLocale cldrLocale, } else { lcr.addOk(); } - } // else: out of coverage level, do not count the path. + } else { + // out of coverage level, do not count the path. + lcr.ignoredOutOfCov ++; + } } } logger.info(et.toString()); @@ -193,6 +205,13 @@ public static class LocaleCompletionResponse { public int provisional = 0; final public String level; + // The following are more or less debug items + public int ignoredLimited = 0; + public int ignoredHidden = 0; + public int allXpaths = 0; + public int statusMissing = 0; + public int ignoredOutOfCov = 0; + LocaleCompletionResponse(Level l) { level = l.name(); }