@vannizhang/living-atlas-content-validator 1.5.22 → 1.5.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/configureSettings.d.ts +0 -103
- package/dist/configureSettings.js +1 -43
- package/dist/configureSettings.js.map +1 -1
- package/dist/index.js +1 -3
- package/dist/index.js.map +1 -1
- package/dist/lib/accessInformation/isValidAccessInformation.d.ts +0 -8
- package/dist/lib/accessInformation/isValidAccessInformation.js +0 -12
- package/dist/lib/accessInformation/isValidAccessInformation.js.map +1 -1
- package/dist/lib/accessInformation/scoringConfig.js +0 -4
- package/dist/lib/accessInformation/scoringConfig.js.map +1 -1
- package/dist/lib/checkProfanities/checkProfanities.d.ts +0 -5
- package/dist/lib/checkProfanities/checkProfanities.js +0 -8
- package/dist/lib/checkProfanities/checkProfanities.js.map +1 -1
- package/dist/lib/checkTitleAndSnippetSearchability/checkTitleAndSnippetSearchability.d.ts +0 -28
- package/dist/lib/checkTitleAndSnippetSearchability/checkTitleAndSnippetSearchability.js +0 -35
- package/dist/lib/checkTitleAndSnippetSearchability/checkTitleAndSnippetSearchability.js.map +1 -1
- package/dist/lib/checkTitleAndSnippetSearchability/config.d.ts +0 -84
- package/dist/lib/checkTitleAndSnippetSearchability/config.js +0 -17
- package/dist/lib/checkTitleAndSnippetSearchability/config.js.map +1 -1
- package/dist/lib/checkTitleAndSnippetSearchability/data.js +0 -692
- package/dist/lib/checkTitleAndSnippetSearchability/data.js.map +1 -1
- package/dist/lib/checkTitleAndSnippetSearchability/helpers.d.ts +0 -94
- package/dist/lib/checkTitleAndSnippetSearchability/helpers.js +0 -105
- package/dist/lib/checkTitleAndSnippetSearchability/helpers.js.map +1 -1
- package/dist/lib/checkTitleAndSnippetSearchability/matchDateTimeInfo.d.ts +0 -28
- package/dist/lib/checkTitleAndSnippetSearchability/matchDateTimeInfo.js +1 -111
- package/dist/lib/checkTitleAndSnippetSearchability/matchDateTimeInfo.js.map +1 -1
- package/dist/lib/checkTitleAndSnippetSearchability/matchLocationInfo.d.ts +0 -28
- package/dist/lib/checkTitleAndSnippetSearchability/matchLocationInfo.js +1 -113
- package/dist/lib/checkTitleAndSnippetSearchability/matchLocationInfo.js.map +1 -1
- package/dist/lib/checkTitleAndSnippetSearchability/matchSourceInfo.d.ts +0 -28
- package/dist/lib/checkTitleAndSnippetSearchability/matchSourceInfo.js +0 -113
- package/dist/lib/checkTitleAndSnippetSearchability/matchSourceInfo.js.map +1 -1
- package/dist/lib/checkTitleAndSnippetSearchability/matchTopicInfo.d.ts +0 -30
- package/dist/lib/checkTitleAndSnippetSearchability/matchTopicInfo.js +1 -115
- package/dist/lib/checkTitleAndSnippetSearchability/matchTopicInfo.js.map +1 -1
- package/dist/lib/checkTitleAndSnippetSearchability/scoringConfig.js +0 -1
- package/dist/lib/checkTitleAndSnippetSearchability/scoringConfig.js.map +1 -1
- package/dist/lib/config.d.ts +0 -16
- package/dist/lib/config.js +0 -140
- package/dist/lib/config.js.map +1 -1
- package/dist/lib/deleteProtection/isDeleteProtectionEnabled.d.ts +0 -8
- package/dist/lib/deleteProtection/isDeleteProtectionEnabled.js +0 -11
- package/dist/lib/deleteProtection/isDeleteProtectionEnabled.js.map +1 -1
- package/dist/lib/deleteProtection/scoringConfig.js +0 -1
- package/dist/lib/deleteProtection/scoringConfig.js.map +1 -1
- package/dist/lib/deprecated/isDeprecated.d.ts +0 -8
- package/dist/lib/deprecated/isDeprecated.js +0 -9
- package/dist/lib/deprecated/isDeprecated.js.map +1 -1
- package/dist/lib/deprecated/scoringConfig.js +0 -1
- package/dist/lib/deprecated/scoringConfig.js.map +1 -1
- package/dist/lib/description/findDataSource.d.ts +0 -10
- package/dist/lib/description/findDataSource.js +0 -22
- package/dist/lib/description/findDataSource.js.map +1 -1
- package/dist/lib/description/isValidDescription.d.ts +0 -17
- package/dist/lib/description/isValidDescription.js +0 -52
- package/dist/lib/description/isValidDescription.js.map +1 -1
- package/dist/lib/description/scoringConfig.js +0 -1
- package/dist/lib/description/scoringConfig.js.map +1 -1
- package/dist/lib/description/scoringRulesConfig.js +0 -47
- package/dist/lib/description/scoringRulesConfig.js.map +1 -1
- package/dist/lib/featureServiceCDNSetting/checkFeatureServiceCDNSetting.d.ts +0 -8
- package/dist/lib/featureServiceCDNSetting/checkFeatureServiceCDNSetting.js +0 -12
- package/dist/lib/featureServiceCDNSetting/checkFeatureServiceCDNSetting.js.map +1 -1
- package/dist/lib/featureServiceExportDataSetting/checkFeatureServiceExportSetting.d.ts +0 -6
- package/dist/lib/featureServiceExportDataSetting/checkFeatureServiceExportSetting.js +0 -12
- package/dist/lib/featureServiceExportDataSetting/checkFeatureServiceExportSetting.js.map +1 -1
- package/dist/lib/featureServiceExtents/checkFeatureServiceExtents.d.ts +0 -8
- package/dist/lib/featureServiceExtents/checkFeatureServiceExtents.js +0 -16
- package/dist/lib/featureServiceExtents/checkFeatureServiceExtents.js.map +1 -1
- package/dist/lib/featureServiceExtents/checkFeatureServiceExtentsHelpers.d.ts +0 -5
- package/dist/lib/featureServiceExtents/checkFeatureServiceExtentsHelpers.js +0 -9
- package/dist/lib/featureServiceExtents/checkFeatureServiceExtentsHelpers.js.map +1 -1
- package/dist/lib/featureServiceFieldAliases/checkFeatureServiceFieldAliases.d.ts +0 -23
- package/dist/lib/featureServiceFieldAliases/checkFeatureServiceFieldAliases.js +0 -43
- package/dist/lib/featureServiceFieldAliases/checkFeatureServiceFieldAliases.js.map +1 -1
- package/dist/lib/featureServiceFieldAliases/helpers.d.ts +0 -16
- package/dist/lib/featureServiceFieldAliases/helpers.js +5 -21
- package/dist/lib/featureServiceFieldAliases/helpers.js.map +1 -1
- package/dist/lib/featureServiceFieldAliases/scoringConfig.js +0 -1
- package/dist/lib/featureServiceFieldAliases/scoringConfig.js.map +1 -1
- package/dist/lib/featureServiceFieldDescriptions/checkFeatureServiceFieldDescriptions.d.ts +0 -22
- package/dist/lib/featureServiceFieldDescriptions/checkFeatureServiceFieldDescriptions.js +0 -58
- package/dist/lib/featureServiceFieldDescriptions/checkFeatureServiceFieldDescriptions.js.map +1 -1
- package/dist/lib/featureServiceFieldDescriptions/helpers.d.ts +0 -17
- package/dist/lib/featureServiceFieldDescriptions/helpers.js +5 -22
- package/dist/lib/featureServiceFieldDescriptions/helpers.js.map +1 -1
- package/dist/lib/featureServiceFieldDescriptions/scoringConfig.js +0 -1
- package/dist/lib/featureServiceFieldDescriptions/scoringConfig.js.map +1 -1
- package/dist/lib/featureServiceFieldIndexes/checkFeatureServiceFieldIndexes.d.ts +0 -8
- package/dist/lib/featureServiceFieldIndexes/checkFeatureServiceFieldIndexes.js +0 -8
- package/dist/lib/featureServiceFieldIndexes/checkFeatureServiceFieldIndexes.js.map +1 -1
- package/dist/lib/featureServiceFieldIndexes/featureServiceFieldIndexesHelpers.d.ts +0 -5
- package/dist/lib/featureServiceFieldIndexes/featureServiceFieldIndexesHelpers.js +0 -6
- package/dist/lib/featureServiceFieldIndexes/featureServiceFieldIndexesHelpers.js.map +1 -1
- package/dist/lib/featureServiceFieldValueTypes/checkFeatureServiceFieldValueTypes.d.ts +0 -19
- package/dist/lib/featureServiceFieldValueTypes/checkFeatureServiceFieldValueTypes.js +0 -40
- package/dist/lib/featureServiceFieldValueTypes/checkFeatureServiceFieldValueTypes.js.map +1 -1
- package/dist/lib/featureServiceFieldValueTypes/helpers.d.ts +0 -13
- package/dist/lib/featureServiceFieldValueTypes/helpers.js +2 -15
- package/dist/lib/featureServiceFieldValueTypes/helpers.js.map +1 -1
- package/dist/lib/featureServiceFieldValueTypes/scoringConfig.js +0 -1
- package/dist/lib/featureServiceFieldValueTypes/scoringConfig.js.map +1 -1
- package/dist/lib/itemExtent/checkItemExtent.d.ts +0 -25
- package/dist/lib/itemExtent/checkItemExtent.js +0 -30
- package/dist/lib/itemExtent/checkItemExtent.js.map +1 -1
- package/dist/lib/itemExtent/checkItemExtentHelpers.d.ts +0 -31
- package/dist/lib/itemExtent/checkItemExtentHelpers.js +0 -36
- package/dist/lib/itemExtent/checkItemExtentHelpers.js.map +1 -1
- package/dist/lib/licenseInfo/isValidLicenseInfo.d.ts +0 -32
- package/dist/lib/licenseInfo/isValidLicenseInfo.js +2 -49
- package/dist/lib/licenseInfo/isValidLicenseInfo.js.map +1 -1
- package/dist/lib/licenseInfo/scoringConfig.js +0 -1
- package/dist/lib/licenseInfo/scoringConfig.js.map +1 -1
- package/dist/lib/licenseInfo/scoringRulesConfig.js +0 -47
- package/dist/lib/licenseInfo/scoringRulesConfig.js.map +1 -1
- package/dist/lib/sharing/isValidAccess.d.ts +0 -20
- package/dist/lib/sharing/isValidAccess.js +2 -28
- package/dist/lib/sharing/isValidAccess.js.map +1 -1
- package/dist/lib/sharing/scoringConfig.js +0 -1
- package/dist/lib/sharing/scoringConfig.js.map +1 -1
- package/dist/lib/sharing/scoringRulesConfig.js +0 -47
- package/dist/lib/sharing/scoringRulesConfig.js.map +1 -1
- package/dist/lib/ssl/isValidSSL.d.ts +0 -12
- package/dist/lib/ssl/isValidSSL.js +6 -31
- package/dist/lib/ssl/isValidSSL.js.map +1 -1
- package/dist/lib/ssl/scoringConfig.js +0 -4
- package/dist/lib/ssl/scoringConfig.js.map +1 -1
- package/dist/lib/ssl/scoringRulesConfig.js +0 -41
- package/dist/lib/ssl/scoringRulesConfig.js.map +1 -1
- package/dist/lib/summary/isValidSummary.d.ts +0 -15
- package/dist/lib/summary/isValidSummary.js +1 -47
- package/dist/lib/summary/isValidSummary.js.map +1 -1
- package/dist/lib/summary/scoringConfig.js +0 -1
- package/dist/lib/summary/scoringConfig.js.map +1 -1
- package/dist/lib/summary/scoringRulesConfig.js +0 -53
- package/dist/lib/summary/scoringRulesConfig.js.map +1 -1
- package/dist/lib/tags/isValidTags.d.ts +0 -12
- package/dist/lib/tags/isValidTags.js +1 -20
- package/dist/lib/tags/isValidTags.js.map +1 -1
- package/dist/lib/tags/scoringConfig.js +0 -5
- package/dist/lib/tags/scoringConfig.js.map +1 -1
- package/dist/lib/tags/scoringRulesConfig.js +0 -41
- package/dist/lib/tags/scoringRulesConfig.js.map +1 -1
- package/dist/lib/thumbnail/isValidThumbnail.d.ts +0 -8
- package/dist/lib/thumbnail/isValidThumbnail.js +1 -30
- package/dist/lib/thumbnail/isValidThumbnail.js.map +1 -1
- package/dist/lib/thumbnail/scoringConfig.js +0 -9
- package/dist/lib/thumbnail/scoringConfig.js.map +1 -1
- package/dist/lib/thumbnail/scoringRulesConfig.js +0 -41
- package/dist/lib/thumbnail/scoringRulesConfig.js.map +1 -1
- package/dist/lib/title/isValidTitle.d.ts +0 -21
- package/dist/lib/title/isValidTitle.js +1 -55
- package/dist/lib/title/isValidTitle.js.map +1 -1
- package/dist/lib/title/scoringConfig.js +0 -1
- package/dist/lib/title/scoringConfig.js.map +1 -1
- package/dist/lib/title/scoringRulesConfig.js +0 -52
- package/dist/lib/title/scoringRulesConfig.js.map +1 -1
- package/dist/lib/userProfileDescription/isValidUserProfileDescription.d.ts +0 -21
- package/dist/lib/userProfileDescription/isValidUserProfileDescription.js +2 -76
- package/dist/lib/userProfileDescription/isValidUserProfileDescription.js.map +1 -1
- package/dist/lib/userProfileDescription/scoringConfig.js +0 -1
- package/dist/lib/userProfileDescription/scoringConfig.js.map +1 -1
- package/dist/lib/userProfileDescription/scoringRulesConfig.js +0 -59
- package/dist/lib/userProfileDescription/scoringRulesConfig.js.map +1 -1
- package/dist/lib/userProfileName/isValidUserProfileName.d.ts +0 -8
- package/dist/lib/userProfileName/isValidUserProfileName.js +2 -26
- package/dist/lib/userProfileName/isValidUserProfileName.js.map +1 -1
- package/dist/lib/userProfileName/scoringConfig.js +0 -5
- package/dist/lib/userProfileName/scoringConfig.js.map +1 -1
- package/dist/lib/userProfileName/scoringRulesConfig.js +0 -41
- package/dist/lib/userProfileName/scoringRulesConfig.js.map +1 -1
- package/dist/lib/userProfileThumbnail/isValidUserProfileThumbnail.d.ts +0 -12
- package/dist/lib/userProfileThumbnail/isValidUserProfileThumbnail.js +3 -27
- package/dist/lib/userProfileThumbnail/isValidUserProfileThumbnail.js.map +1 -1
- package/dist/lib/userProfileThumbnail/scoringConfig.js +0 -4
- package/dist/lib/userProfileThumbnail/scoringConfig.js.map +1 -1
- package/dist/lib/userProfileThumbnail/scoringRulesConfig.js +0 -35
- package/dist/lib/userProfileThumbnail/scoringRulesConfig.js.map +1 -1
- package/dist/lib/util/assertString.d.ts +0 -10
- package/dist/lib/util/assertString.js +0 -11
- package/dist/lib/util/assertString.js.map +1 -1
- package/dist/lib/util/checkIsLayer.d.ts +0 -5
- package/dist/lib/util/checkIsLayer.js +0 -5
- package/dist/lib/util/checkIsLayer.js.map +1 -1
- package/dist/lib/util/contains.d.ts +0 -6
- package/dist/lib/util/contains.js +0 -7
- package/dist/lib/util/contains.js.map +1 -1
- package/dist/lib/util/containsNonEnglishCharacters.d.ts +0 -12
- package/dist/lib/util/containsNonEnglishCharacters.js +2 -16
- package/dist/lib/util/containsNonEnglishCharacters.js.map +1 -1
- package/dist/lib/util/countSentences.d.ts +0 -22
- package/dist/lib/util/countSentences.js +4 -36
- package/dist/lib/util/countSentences.js.map +1 -1
- package/dist/lib/util/createWordBoundaryRegex.d.ts +0 -40
- package/dist/lib/util/createWordBoundaryRegex.js +0 -47
- package/dist/lib/util/createWordBoundaryRegex.js.map +1 -1
- package/dist/lib/util/escapeSpecialCharacters.d.ts +0 -6
- package/dist/lib/util/escapeSpecialCharacters.js +0 -8
- package/dist/lib/util/escapeSpecialCharacters.js.map +1 -1
- package/dist/lib/util/getAllValidationRuleIds.d.ts +0 -4
- package/dist/lib/util/getAllValidationRuleIds.js +0 -4
- package/dist/lib/util/getAllValidationRuleIds.js.map +1 -1
- package/dist/lib/util/getFeatureLayerFieldValueTypes.d.ts +0 -8
- package/dist/lib/util/getFeatureLayerFieldValueTypes.js +0 -8
- package/dist/lib/util/getFeatureLayerFieldValueTypes.js.map +1 -1
- package/dist/lib/util/getLivingAtlasSupportedItemTypes.d.ts +0 -17
- package/dist/lib/util/getLivingAtlasSupportedItemTypes.js +0 -17
- package/dist/lib/util/getLivingAtlasSupportedItemTypes.js.map +1 -1
- package/dist/lib/util/getNumberOfWords.d.ts +0 -5
- package/dist/lib/util/getNumberOfWords.js +1 -15
- package/dist/lib/util/getNumberOfWords.js.map +1 -1
- package/dist/lib/util/getRelevantFeatureLayerFields.d.ts +0 -11
- package/dist/lib/util/getRelevantFeatureLayerFields.js +0 -11
- package/dist/lib/util/getRelevantFeatureLayerFields.js.map +1 -1
- package/dist/lib/util/getScoringRules.d.ts +0 -17
- package/dist/lib/util/getScoringRules.js +0 -105
- package/dist/lib/util/getScoringRules.js.map +1 -1
- package/dist/lib/util/getThumbnailFileName.d.ts +0 -14
- package/dist/lib/util/getThumbnailFileName.js +0 -14
- package/dist/lib/util/getThumbnailFileName.js.map +1 -1
- package/dist/lib/util/isArcGISDomain.d.ts +0 -5
- package/dist/lib/util/isArcGISDomain.js +0 -5
- package/dist/lib/util/isArcGISDomain.js.map +1 -1
- package/dist/lib/util/isArcGISOnlineReservedThumbnailName.d.ts +0 -5
- package/dist/lib/util/isArcGISOnlineReservedThumbnailName.js +0 -5
- package/dist/lib/util/isArcGISOnlineReservedThumbnailName.js.map +1 -1
- package/dist/lib/util/isDefined.d.ts +0 -7
- package/dist/lib/util/isDefined.js +0 -7
- package/dist/lib/util/isDefined.js.map +1 -1
- package/dist/lib/util/isEmail.d.ts +0 -5
- package/dist/lib/util/isEmail.js +0 -5
- package/dist/lib/util/isEmail.js.map +1 -1
- package/dist/lib/util/isEmpty.d.ts +0 -5
- package/dist/lib/util/isEmpty.js +0 -5
- package/dist/lib/util/isEmpty.js.map +1 -1
- package/dist/lib/util/isFeatureCollection.d.ts +0 -5
- package/dist/lib/util/isFeatureCollection.js +0 -5
- package/dist/lib/util/isFeatureCollection.js.map +1 -1
- package/dist/lib/util/isFeatureService.d.ts +0 -11
- package/dist/lib/util/isFeatureService.js +0 -13
- package/dist/lib/util/isFeatureService.js.map +1 -1
- package/dist/lib/util/isHosted.d.ts +0 -5
- package/dist/lib/util/isHosted.js +0 -5
- package/dist/lib/util/isHosted.js.map +1 -1
- package/dist/lib/util/isLatin.d.ts +0 -5
- package/dist/lib/util/isLatin.js +0 -5
- package/dist/lib/util/isLatin.js.map +1 -1
- package/dist/lib/util/isLayer.d.ts +0 -10
- package/dist/lib/util/isLayer.js +1 -13
- package/dist/lib/util/isLayer.js.map +1 -1
- package/dist/lib/util/isSecureProtocol.d.ts +0 -5
- package/dist/lib/util/isSecureProtocol.js +0 -5
- package/dist/lib/util/isSecureProtocol.js.map +1 -1
- package/dist/lib/util/isUppercase.d.ts +0 -3
- package/dist/lib/util/isUppercase.js +0 -3
- package/dist/lib/util/isUppercase.js.map +1 -1
- package/dist/lib/util/isUrl.d.ts +0 -8
- package/dist/lib/util/isUrl.js +1 -11
- package/dist/lib/util/isUrl.js.map +1 -1
- package/dist/lib/util/isValidRegexPattern.d.ts +0 -6
- package/dist/lib/util/isValidRegexPattern.js +0 -6
- package/dist/lib/util/isValidRegexPattern.js.map +1 -1
- package/dist/lib/util/matches.d.ts +0 -11
- package/dist/lib/util/matches.js +0 -11
- package/dist/lib/util/matches.js.map +1 -1
- package/dist/lib/util/round.js +0 -4
- package/dist/lib/util/round.js.map +1 -1
- package/dist/lib/util/sanitizeTags.d.ts +0 -5
- package/dist/lib/util/sanitizeTags.js +0 -5
- package/dist/lib/util/sanitizeTags.js.map +1 -1
- package/dist/lib/util/shouldValidateByBetaRules.d.ts +0 -7
- package/dist/lib/util/shouldValidateByBetaRules.js +0 -31
- package/dist/lib/util/shouldValidateByBetaRules.js.map +1 -1
- package/dist/lib/util/stringsConfig.d.ts +0 -21
- package/dist/lib/util/stringsConfig.js +0 -38
- package/dist/lib/util/stringsConfig.js.map +1 -1
- package/dist/lib/util/toString.d.ts +0 -10
- package/dist/lib/util/toString.js +0 -10
- package/dist/lib/util/toString.js.map +1 -1
- package/dist/lib/validate/validate.d.ts +0 -64
- package/dist/lib/validate/validate.js +1 -52
- package/dist/lib/validate/validate.js.map +1 -1
- package/dist/lib/validate/validateHelpers.d.ts +0 -57
- package/dist/lib/validate/validateHelpers.js +1 -72
- package/dist/lib/validate/validateHelpers.js.map +1 -1
- package/dist/package-info.json +1 -1
- package/dist/services/content-validator-assets/config.d.ts +0 -3
- package/dist/services/content-validator-assets/config.js +0 -3
- package/dist/services/content-validator-assets/config.js.map +1 -1
- package/dist/services/content-validator-assets/fetchAdditonalPatterns4TitleAndSnippetSearchability.d.ts +0 -93
- package/dist/services/content-validator-assets/fetchAdditonalPatterns4TitleAndSnippetSearchability.js +0 -33
- package/dist/services/content-validator-assets/fetchAdditonalPatterns4TitleAndSnippetSearchability.js.map +1 -1
- package/dist/services/content-validator-assets/fetchProfanitiesData.d.ts +0 -24
- package/dist/services/content-validator-assets/fetchProfanitiesData.js +0 -19
- package/dist/services/content-validator-assets/fetchProfanitiesData.js.map +1 -1
- package/dist/services/content-validator-assets/helpers.d.ts +0 -14
- package/dist/services/content-validator-assets/helpers.js +1 -15
- package/dist/services/content-validator-assets/helpers.js.map +1 -1
- package/dist/services/custom-terms/config.d.ts +0 -11
- package/dist/services/custom-terms/config.js +0 -41
- package/dist/services/custom-terms/config.js.map +1 -1
- package/dist/services/custom-terms/customTerms.d.ts +0 -170
- package/dist/services/custom-terms/customTerms.js +4 -169
- package/dist/services/custom-terms/customTerms.js.map +1 -1
- package/dist/services/custom-terms/helpers.d.ts +0 -6
- package/dist/services/custom-terms/helpers.js +0 -6
- package/dist/services/custom-terms/helpers.js.map +1 -1
- package/dist/services/custom-terms-review-results/config.d.ts +0 -16
- package/dist/services/custom-terms-review-results/config.js +0 -42
- package/dist/services/custom-terms-review-results/config.js.map +1 -1
- package/dist/services/custom-terms-review-results/customTermsReviewResults.d.ts +0 -93
- package/dist/services/custom-terms-review-results/customTermsReviewResults.js +0 -87
- package/dist/services/custom-terms-review-results/customTermsReviewResults.js.map +1 -1
- package/dist/services/custom-terms-review-results/helpers.d.ts +0 -15
- package/dist/services/custom-terms-review-results/helpers.js +0 -16
- package/dist/services/custom-terms-review-results/helpers.js.map +1 -1
- package/dist/services/feature-service/fetchFeatureServiceAdminJSON.d.ts +0 -12
- package/dist/services/feature-service/fetchFeatureServiceAdminJSON.js +0 -13
- package/dist/services/feature-service/fetchFeatureServiceAdminJSON.js.map +1 -1
- package/dist/services/feature-service/fetchFeatureServiceLayersAndTables.d.ts +0 -12
- package/dist/services/feature-service/fetchFeatureServiceLayersAndTables.js +2 -37
- package/dist/services/feature-service/fetchFeatureServiceLayersAndTables.js.map +1 -1
- package/dist/services/feature-service/fetchFeatureServiceRootJSON.d.ts +0 -14
- package/dist/services/feature-service/fetchFeatureServiceRootJSON.js +1 -25
- package/dist/services/feature-service/fetchFeatureServiceRootJSON.js.map +1 -1
- package/dist/services/feature-service/getFeatureServerURL.d.ts +0 -11
- package/dist/services/feature-service/getFeatureServerURL.js +2 -14
- package/dist/services/feature-service/getFeatureServerURL.js.map +1 -1
- package/dist/services/shared/addFeatures.d.ts +0 -11
- package/dist/services/shared/addFeatures.js +0 -11
- package/dist/services/shared/addFeatures.js.map +1 -1
- package/dist/services/shared/applyEdits.d.ts +0 -11
- package/dist/services/shared/applyEdits.js +0 -11
- package/dist/services/shared/applyEdits.js.map +1 -1
- package/dist/services/shared/config.d.ts +0 -38
- package/dist/services/shared/config.js +0 -22
- package/dist/services/shared/config.js.map +1 -1
- package/dist/services/shared/getItemInfo.d.ts +0 -12
- package/dist/services/shared/getItemInfo.js +1 -16
- package/dist/services/shared/getItemInfo.js.map +1 -1
- package/dist/types/index.d.ts +0 -335
- package/dist/types/index.js +0 -19
- package/dist/types/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"data.js","sourceRoot":"","sources":["../../../src/lib/checkTitleAndSnippetSearchability/data.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"data.js","sourceRoot":"","sources":["../../../src/lib/checkTitleAndSnippetSearchability/data.ts"],"names":[],"mappings":""}
|
|
@@ -1,117 +1,23 @@
|
|
|
1
1
|
import { IItem, IUser } from '../../types';
|
|
2
2
|
type MatchUsingMultiplePatternsParams = {
|
|
3
|
-
/**
|
|
4
|
-
* The item to be checked for searchability.
|
|
5
|
-
*/
|
|
6
3
|
item: IItem;
|
|
7
|
-
/**
|
|
8
|
-
* The predefined patterns to match against the item's title and snippet.
|
|
9
|
-
*/
|
|
10
4
|
predefinedPatterns: RegExp;
|
|
11
|
-
/**
|
|
12
|
-
* Additional patterns to match against the item's title and snippet if no match is found with predefined patterns.
|
|
13
|
-
* These extra matching patterns are the patterns submitted by the user that have been approved by the Living Atlas team.
|
|
14
|
-
*/
|
|
15
5
|
extraPatterns: RegExp;
|
|
16
|
-
/**
|
|
17
|
-
* Custom terms to match against the item's title and snippet if no match is found with predefined or extra patterns.
|
|
18
|
-
* These custom terms are the terms users submitted using the Nominatim App
|
|
19
|
-
*/
|
|
20
6
|
customTerms: string[];
|
|
21
|
-
/**
|
|
22
|
-
* A set of terms that have been rejected by the Living Atlas team.
|
|
23
|
-
* any custom term that is found in this set will be ignored.
|
|
24
|
-
*/
|
|
25
7
|
rejectedSet: Set<string>;
|
|
26
8
|
};
|
|
27
|
-
/**
|
|
28
|
-
* Represents the source of a match pattern.
|
|
29
|
-
*
|
|
30
|
-
*/
|
|
31
9
|
export type MatchPatternSource = 'predefined' | 'additional' | 'custom';
|
|
32
|
-
/**
|
|
33
|
-
* Represents the result of a pattern match operation.
|
|
34
|
-
*/
|
|
35
10
|
export type MatchResult = {
|
|
36
|
-
/**
|
|
37
|
-
* The string that was matched by the pattern.
|
|
38
|
-
*/
|
|
39
11
|
matchedString: string;
|
|
40
|
-
/**
|
|
41
|
-
* The source of the pattern that was used for matching: `'predefined' | 'additional' | 'custom'`
|
|
42
|
-
*/
|
|
43
12
|
patternSource: MatchPatternSource;
|
|
44
13
|
};
|
|
45
|
-
/**
|
|
46
|
-
* Checks if a string is found in a set of strings.
|
|
47
|
-
* @param str string to be checked
|
|
48
|
-
* @param set set of strings to be checked against
|
|
49
|
-
* @returns true if the string is found in the set, false otherwise
|
|
50
|
-
*/
|
|
51
14
|
export declare const isFoundInSet: (str: string, set: Set<string>) => boolean;
|
|
52
|
-
/**
|
|
53
|
-
* Matches patterns in an item's title and snippet using a hierarchical approach:
|
|
54
|
-
* predefined patterns first, followed by extra patterns, and finally custom terms.
|
|
55
|
-
*
|
|
56
|
-
* @param {MatchUsingMultiplePatternsParams} params - The parameters for pattern matching.
|
|
57
|
-
* @param {IItem} params.item - The item containing the title and snippet to search for patterns.
|
|
58
|
-
* @param {RegExp} params.predefinedPatterns - The predefined patterns to match against the item's title and snippet.
|
|
59
|
-
* @param {RegExp} params.extraPatterns - Additional patterns to match against the item's title and snippet if no match is found with predefined patterns. These extra matching patterns are the patterns submitted by users and approved by the Living Atlas team.
|
|
60
|
-
* @param {string[]} params.customTerms - Custom terms to match against the item's title and snippet if no match is found with predefined or extra patterns. These custom terms are user-submitted via the Nominatim App.
|
|
61
|
-
* @param {Set<string>} params.rejectedSet - A set of terms rejected by the Living Atlas team. Any custom term found in this set will be ignored.
|
|
62
|
-
*
|
|
63
|
-
* @returns {string[]} - An array of matched strings after deduplication and filtering.
|
|
64
|
-
*/
|
|
65
15
|
export declare const matchUsingMultiplePatterns: ({ item, predefinedPatterns, extraPatterns, customTerms, rejectedSet, }: MatchUsingMultiplePatternsParams) => MatchResult[];
|
|
66
|
-
/**
|
|
67
|
-
* Matches patterns in the title and snippet of an item.
|
|
68
|
-
* @param item ArcGIS item object to be matched.
|
|
69
|
-
* @param regex Regular expression to match.
|
|
70
|
-
* @returns Array of matched strings.
|
|
71
|
-
*/
|
|
72
16
|
export declare const matchPatternsInTitleAndSnippet: (item: IItem, regex: RegExp, patternSource: MatchPatternSource) => MatchResult[];
|
|
73
|
-
/**
|
|
74
|
-
* Matches custom patterns in the title and snippet of an item.
|
|
75
|
-
* @param item ArcGIS item object to be matched.
|
|
76
|
-
* @param customMatchingPatterns Array of custom patterns to match.
|
|
77
|
-
* @param rejectedSet Set of rejected patterns.
|
|
78
|
-
*
|
|
79
|
-
* @returns Array of matched strings.
|
|
80
|
-
*/
|
|
81
17
|
export declare const matchWithCustomPatterns: (item: IItem, customMatchingPatterns: string[], rejectedSet: Set<string>) => MatchResult[];
|
|
82
|
-
/**
|
|
83
|
-
* Get a Set from an array of strings and convert all strings to lowercase.
|
|
84
|
-
* @param arr - The array of strings to convert to a Set
|
|
85
|
-
* @returns set - A Set containing the strings from the array
|
|
86
|
-
*/
|
|
87
18
|
export declare const toLowercaseSet: (arr: string[]) => Set<string>;
|
|
88
|
-
/**
|
|
89
|
-
* Determines if an item is eligible for checking title and snippet searchability.
|
|
90
|
-
*
|
|
91
|
-
* @param item {IITem} - The item to check.
|
|
92
|
-
* @returns {boolean} if the item meets the criteria for checking title and snippet searchability, otherwise `false`.
|
|
93
|
-
*
|
|
94
|
-
* The criteria for eligibility are:
|
|
95
|
-
* 1. The item is a layer.
|
|
96
|
-
* 2. The item is English-based.
|
|
97
|
-
* 3. The item's culture is 'en' or the item's owner is one of the English-based owners.
|
|
98
|
-
*
|
|
99
|
-
* @remarks
|
|
100
|
-
* - The locale is determined by both the item's culture and the item's owner.
|
|
101
|
-
*/
|
|
102
19
|
export declare const isEligibleForCheckingTitleAndSnippetSearchability: (item: IItem, itemOwner: IUser) => boolean;
|
|
103
|
-
/**
|
|
104
|
-
* Clean up matched results by removing empty and duplicate strings.
|
|
105
|
-
* @param matchedResults array of matched results
|
|
106
|
-
* @returns an array of cleaned up matched MatchResult
|
|
107
|
-
*/
|
|
108
20
|
export declare const cleanUpMatchedResults: (matchedResults: MatchResult[]) => MatchResult[];
|
|
109
21
|
export declare const removeOverlapped: (arr: MatchResult[]) => MatchResult[];
|
|
110
|
-
/**
|
|
111
|
-
* Removes duplicate matched results from an array, ignoring case sensitivity.
|
|
112
|
-
*
|
|
113
|
-
* @param arr - The array of MatchResult to deduplicate.
|
|
114
|
-
* @returns A new array with duplicates removed, preserving the original case of the first occurrence.
|
|
115
|
-
*/
|
|
116
22
|
export declare const deduplicate: (arr: MatchResult[]) => MatchResult[];
|
|
117
23
|
export {};
|
|
@@ -4,57 +4,28 @@ exports.deduplicate = exports.removeOverlapped = exports.cleanUpMatchedResults =
|
|
|
4
4
|
const isLayer_1 = require("../util/isLayer");
|
|
5
5
|
const getScoringRules_1 = require("../util/getScoringRules");
|
|
6
6
|
const createWordBoundaryRegex_1 = require("../util/createWordBoundaryRegex");
|
|
7
|
-
/**
|
|
8
|
-
* Checks if a string is found in a set of strings.
|
|
9
|
-
* @param str string to be checked
|
|
10
|
-
* @param set set of strings to be checked against
|
|
11
|
-
* @returns true if the string is found in the set, false otherwise
|
|
12
|
-
*/
|
|
13
7
|
const isFoundInSet = (str, set) => {
|
|
14
8
|
if (!set) {
|
|
15
9
|
return false;
|
|
16
10
|
}
|
|
17
|
-
// str = escapeSpecialCharacters([str])[0];
|
|
18
11
|
if (!str) {
|
|
19
12
|
return false;
|
|
20
13
|
}
|
|
21
14
|
return set.has(str.toLowerCase());
|
|
22
15
|
};
|
|
23
16
|
exports.isFoundInSet = isFoundInSet;
|
|
24
|
-
/**
|
|
25
|
-
* Matches patterns in an item's title and snippet using a hierarchical approach:
|
|
26
|
-
* predefined patterns first, followed by extra patterns, and finally custom terms.
|
|
27
|
-
*
|
|
28
|
-
* @param {MatchUsingMultiplePatternsParams} params - The parameters for pattern matching.
|
|
29
|
-
* @param {IItem} params.item - The item containing the title and snippet to search for patterns.
|
|
30
|
-
* @param {RegExp} params.predefinedPatterns - The predefined patterns to match against the item's title and snippet.
|
|
31
|
-
* @param {RegExp} params.extraPatterns - Additional patterns to match against the item's title and snippet if no match is found with predefined patterns. These extra matching patterns are the patterns submitted by users and approved by the Living Atlas team.
|
|
32
|
-
* @param {string[]} params.customTerms - Custom terms to match against the item's title and snippet if no match is found with predefined or extra patterns. These custom terms are user-submitted via the Nominatim App.
|
|
33
|
-
* @param {Set<string>} params.rejectedSet - A set of terms rejected by the Living Atlas team. Any custom term found in this set will be ignored.
|
|
34
|
-
*
|
|
35
|
-
* @returns {string[]} - An array of matched strings after deduplication and filtering.
|
|
36
|
-
*/
|
|
37
17
|
const matchUsingMultiplePatterns = ({ item, predefinedPatterns, extraPatterns, customTerms, rejectedSet, }) => {
|
|
38
|
-
// try to match with predefined patterns first
|
|
39
18
|
const matchedByPredefinedPatterns = (0, exports.matchPatternsInTitleAndSnippet)(item, predefinedPatterns, 'predefined');
|
|
40
19
|
if (matchedByPredefinedPatterns.length) {
|
|
41
20
|
return matchedByPredefinedPatterns;
|
|
42
21
|
}
|
|
43
|
-
// if no match, try to match with extra patterns
|
|
44
22
|
const matchedByAdditionalPatterns = (0, exports.matchPatternsInTitleAndSnippet)(item, extraPatterns, 'additional');
|
|
45
23
|
if (matchedByAdditionalPatterns.length) {
|
|
46
24
|
return matchedByAdditionalPatterns;
|
|
47
25
|
}
|
|
48
|
-
// if no match, try to match with custom terms
|
|
49
26
|
return (0, exports.matchWithCustomPatterns)(item, customTerms, rejectedSet);
|
|
50
27
|
};
|
|
51
28
|
exports.matchUsingMultiplePatterns = matchUsingMultiplePatterns;
|
|
52
|
-
/**
|
|
53
|
-
* Matches patterns in the title and snippet of an item.
|
|
54
|
-
* @param item ArcGIS item object to be matched.
|
|
55
|
-
* @param regex Regular expression to match.
|
|
56
|
-
* @returns Array of matched strings.
|
|
57
|
-
*/
|
|
58
29
|
const matchPatternsInTitleAndSnippet = (item, regex, patternSource) => {
|
|
59
30
|
const title = (item === null || item === void 0 ? void 0 : item.title) || '';
|
|
60
31
|
const snippet = (item === null || item === void 0 ? void 0 : item.snippet) || '';
|
|
@@ -65,12 +36,6 @@ const matchPatternsInTitleAndSnippet = (item, regex, patternSource) => {
|
|
|
65
36
|
return [];
|
|
66
37
|
}
|
|
67
38
|
try {
|
|
68
|
-
// const matchedStrFromTitle: string[] = title.match(regex) || [];
|
|
69
|
-
// const matchedStrFromSnippet: string[] = snippet.match(regex) || [];
|
|
70
|
-
// return cleanUpMatchedResults([
|
|
71
|
-
// ...matchedStrFromTitle,
|
|
72
|
-
// ...matchedStrFromSnippet,
|
|
73
|
-
// ]);
|
|
74
39
|
if (!regex.flags.includes('g')) {
|
|
75
40
|
regex = new RegExp(regex.source, `${regex.flags}g`);
|
|
76
41
|
}
|
|
@@ -88,56 +53,20 @@ const matchPatternsInTitleAndSnippet = (item, regex, patternSource) => {
|
|
|
88
53
|
}
|
|
89
54
|
};
|
|
90
55
|
exports.matchPatternsInTitleAndSnippet = matchPatternsInTitleAndSnippet;
|
|
91
|
-
/**
|
|
92
|
-
* Matches custom patterns in the title and snippet of an item.
|
|
93
|
-
* @param item ArcGIS item object to be matched.
|
|
94
|
-
* @param customMatchingPatterns Array of custom patterns to match.
|
|
95
|
-
* @param rejectedSet Set of rejected patterns.
|
|
96
|
-
*
|
|
97
|
-
* @returns Array of matched strings.
|
|
98
|
-
*/
|
|
99
56
|
const matchWithCustomPatterns = (item, customMatchingPatterns, rejectedSet) => {
|
|
100
57
|
if (!customMatchingPatterns || customMatchingPatterns.length === 0) {
|
|
101
58
|
return [];
|
|
102
59
|
}
|
|
103
|
-
// remove any leading and trailing spaces
|
|
104
|
-
// and filter out any empty strings and rejected patterns
|
|
105
|
-
// return an empty array if no patterns left after filtering
|
|
106
60
|
customMatchingPatterns = customMatchingPatterns
|
|
107
61
|
.map((pattern) => pattern.trim())
|
|
108
62
|
.filter((pattern) => pattern !== '' && (0, exports.isFoundInSet)(pattern, rejectedSet) === false);
|
|
109
63
|
if (customMatchingPatterns.length === 0) {
|
|
110
64
|
return [];
|
|
111
65
|
}
|
|
112
|
-
// const escapedCustomPatterns = escapeSpecialCharacters(
|
|
113
|
-
// customMatchingPatterns
|
|
114
|
-
// );
|
|
115
|
-
// const customPatternsRegex = new RegExp(
|
|
116
|
-
// `\\b(${escapedCustomPatterns.join('|')})\\b`,
|
|
117
|
-
// 'gi'
|
|
118
|
-
// );
|
|
119
|
-
// const matchedStrFromTitle = title.match(customPatternsRegex) || [];
|
|
120
|
-
// const matchedStrFromSnippet = snippet.match(customPatternsRegex) || [];
|
|
121
|
-
// if (!matchedStrFromTitle.length && !matchedStrFromSnippet.length) {
|
|
122
|
-
// return [];
|
|
123
|
-
// }
|
|
124
|
-
// // console.log('matchedStrFromTitle', matchedStrFromTitle);
|
|
125
|
-
// // console.log('matchedStrFromSnippet', matchedStrFromSnippet);
|
|
126
|
-
// const output = deduplicate([
|
|
127
|
-
// ...matchedStrFromTitle,
|
|
128
|
-
// ...matchedStrFromSnippet,
|
|
129
|
-
// ]);
|
|
130
|
-
// // console.log('output', output);
|
|
131
|
-
// return removeOverlapped(output);
|
|
132
66
|
const customPatternsRegex = (0, createWordBoundaryRegex_1.createWordBoundaryRegex)(customMatchingPatterns);
|
|
133
67
|
return (0, exports.matchPatternsInTitleAndSnippet)(item, customPatternsRegex, 'custom');
|
|
134
68
|
};
|
|
135
69
|
exports.matchWithCustomPatterns = matchWithCustomPatterns;
|
|
136
|
-
/**
|
|
137
|
-
* Get a Set from an array of strings and convert all strings to lowercase.
|
|
138
|
-
* @param arr - The array of strings to convert to a Set
|
|
139
|
-
* @returns set - A Set containing the strings from the array
|
|
140
|
-
*/
|
|
141
70
|
const toLowercaseSet = (arr) => {
|
|
142
71
|
if (!arr || arr.length === 0) {
|
|
143
72
|
return new Set();
|
|
@@ -146,20 +75,6 @@ const toLowercaseSet = (arr) => {
|
|
|
146
75
|
return new Set(strs);
|
|
147
76
|
};
|
|
148
77
|
exports.toLowercaseSet = toLowercaseSet;
|
|
149
|
-
/**
|
|
150
|
-
* Determines if an item is eligible for checking title and snippet searchability.
|
|
151
|
-
*
|
|
152
|
-
* @param item {IITem} - The item to check.
|
|
153
|
-
* @returns {boolean} if the item meets the criteria for checking title and snippet searchability, otherwise `false`.
|
|
154
|
-
*
|
|
155
|
-
* The criteria for eligibility are:
|
|
156
|
-
* 1. The item is a layer.
|
|
157
|
-
* 2. The item is English-based.
|
|
158
|
-
* 3. The item's culture is 'en' or the item's owner is one of the English-based owners.
|
|
159
|
-
*
|
|
160
|
-
* @remarks
|
|
161
|
-
* - The locale is determined by both the item's culture and the item's owner.
|
|
162
|
-
*/
|
|
163
78
|
const isEligibleForCheckingTitleAndSnippetSearchability = (item, itemOwner) => {
|
|
164
79
|
if (!item) {
|
|
165
80
|
return false;
|
|
@@ -171,33 +86,19 @@ const isEligibleForCheckingTitleAndSnippetSearchability = (item, itemOwner) => {
|
|
|
171
86
|
const localeByCultreProperty = (0, getScoringRules_1.getScoringRulesLocale)(item.culture);
|
|
172
87
|
const localeByItemOwner = (0, getScoringRules_1.getScoringRulesLocaleByItemOwner)(item.owner);
|
|
173
88
|
const itemOwnerCultureProperty = (0, getScoringRules_1.getScoringRulesLocale)(itemOwner === null || itemOwner === void 0 ? void 0 : itemOwner.culture);
|
|
174
|
-
// const title = item?.title || '';
|
|
175
|
-
// const snippet = item?.snippet || '';
|
|
176
|
-
// We removed the non-English character check since it was too restrictive.
|
|
177
|
-
// Some valid English-based content (like Esri Oceans data) may contain special characters
|
|
178
|
-
// such as Greek letters while still being primarily English content.
|
|
179
89
|
const isEnglishedBased = localeByCultreProperty === 'en' &&
|
|
180
90
|
localeByItemOwner === 'en' &&
|
|
181
91
|
itemOwnerCultureProperty === 'en';
|
|
182
|
-
// && containsNonEnglishCharacters(title + ' ' + snippet) === false;
|
|
183
92
|
return isEnglishedBased;
|
|
184
93
|
};
|
|
185
94
|
exports.isEligibleForCheckingTitleAndSnippetSearchability = isEligibleForCheckingTitleAndSnippetSearchability;
|
|
186
|
-
/**
|
|
187
|
-
* Clean up matched results by removing empty and duplicate strings.
|
|
188
|
-
* @param matchedResults array of matched results
|
|
189
|
-
* @returns an array of cleaned up matched MatchResult
|
|
190
|
-
*/
|
|
191
95
|
const cleanUpMatchedResults = (matchedResults) => {
|
|
192
96
|
if (!matchedResults || matchedResults.length === 0) {
|
|
193
97
|
return [];
|
|
194
98
|
}
|
|
195
|
-
// remove any leading and trailing spaces
|
|
196
|
-
// and filter out any empty strings
|
|
197
99
|
matchedResults = matchedResults.filter((d) => d.matchedString.trim() !== '');
|
|
198
100
|
const candidates = (0, exports.deduplicate)(matchedResults);
|
|
199
101
|
return candidates;
|
|
200
|
-
// return removeOverlapped(candidates);
|
|
201
102
|
};
|
|
202
103
|
exports.cleanUpMatchedResults = cleanUpMatchedResults;
|
|
203
104
|
const removeOverlapped = (arr) => {
|
|
@@ -221,12 +122,6 @@ const removeOverlapped = (arr) => {
|
|
|
221
122
|
return output;
|
|
222
123
|
};
|
|
223
124
|
exports.removeOverlapped = removeOverlapped;
|
|
224
|
-
/**
|
|
225
|
-
* Removes duplicate matched results from an array, ignoring case sensitivity.
|
|
226
|
-
*
|
|
227
|
-
* @param arr - The array of MatchResult to deduplicate.
|
|
228
|
-
* @returns A new array with duplicates removed, preserving the original case of the first occurrence.
|
|
229
|
-
*/
|
|
230
125
|
const deduplicate = (arr) => {
|
|
231
126
|
if (!arr || arr.length === 0) {
|
|
232
127
|
return [];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../../src/lib/checkTitleAndSnippetSearchability/helpers.ts"],"names":[],"mappings":";;;AACA,6CAA0C;AAC1C,6DAGiC;AAEjC,6EAA0E;
|
|
1
|
+
{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../../src/lib/checkTitleAndSnippetSearchability/helpers.ts"],"names":[],"mappings":";;;AACA,6CAA0C;AAC1C,6DAGiC;AAEjC,6EAA0E;AAuDnE,MAAM,YAAY,GAAG,CAAC,GAAW,EAAE,GAAgB,EAAE,EAAE;IAC1D,IAAI,CAAC,GAAG,EAAE,CAAC;QACP,OAAO,KAAK,CAAC;IACjB,CAAC;IAID,IAAI,CAAC,GAAG,EAAE,CAAC;QACP,OAAO,KAAK,CAAC;IACjB,CAAC;IAED,OAAO,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,WAAW,EAAE,CAAC,CAAC;AACtC,CAAC,CAAC;AAZW,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AAG,EAAU,CAAC;IAE/B,OAAO,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE;QACpB,MAAM,QAAQ,GAAG,CAAC,CAAC,aAAa,CAAC,WAAW,EAAE,CAAC;QAC/C,IAAI,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE,CAAC;YACrB,OAAO,KAAK,CAAC;QACjB,CAAC;QACD,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;QACnB,OAAO,IAAI,CAAC;IAChB,CAAC,CAAC,CAAC;AACP,CAAC,CAAC;AAfW,QAAA,WAAW,eAetB"}
|
|
@@ -1,34 +1,6 @@
|
|
|
1
1
|
import { IItem } from '../../types';
|
|
2
2
|
import { MatchResult } from './helpers';
|
|
3
|
-
/**
|
|
4
|
-
* Sets the extra matching patterns and rejected patterns for date-time information.
|
|
5
|
-
*
|
|
6
|
-
* @param extraMatchingPatterns - An array of strings representing the extra matching patterns.
|
|
7
|
-
* @param extraRejectedPatterns - An array of strings representing the extra rejected patterns.
|
|
8
|
-
* @param {boolean} [shouldAvoidUsingWordBoundary=false] - A boolean indicating whether to avoid using word boundaries (useful for languages like Chinese and Japanese).
|
|
9
|
-
*
|
|
10
|
-
* @remarks
|
|
11
|
-
* - For languages like Japanese that don't use spaces between words (or where word boundaries are not easily determined by spaces or punctuation),
|
|
12
|
-
* set `shouldAvoidUsingWordBoundary` to true to remove `\b` and use lookarounds to ensure correct boundaries.
|
|
13
|
-
*/
|
|
14
3
|
export declare const setExtraDateTimeInfoMatchingPatterns: (extraMatchingPatterns: string[], extraRejectedPatterns: string[], shouldAvoidUsingWordBoundary?: boolean) => void;
|
|
15
|
-
/**
|
|
16
|
-
* Matches date and time information from the title and snippet of an item.
|
|
17
|
-
*
|
|
18
|
-
* @param {IItem} item - The item containing title and snippet to be matched against.
|
|
19
|
-
* @param {string[]} [customMatchingPattenrs] - Optional custom matching patterns to be included in the regex.
|
|
20
|
-
* @returns {string[]} - An array of matched date and time information strings.
|
|
21
|
-
*/
|
|
22
4
|
export declare const matchDateTimeInfo: (item: IItem, customMatchingPattenrs?: string[]) => MatchResult[];
|
|
23
|
-
/**
|
|
24
|
-
* Check if the provided string contains recognized date and time information.
|
|
25
|
-
* @param str - The string to check.
|
|
26
|
-
* @returns {boolean} - True if the string contains recognized date and time information, false otherwise.
|
|
27
|
-
*/
|
|
28
5
|
export declare const isRecognizedDateTimeInfo: (str: string) => boolean;
|
|
29
|
-
/**
|
|
30
|
-
* Determines if a given string is a rejected topic.
|
|
31
|
-
* @param str - The string to check.
|
|
32
|
-
* @returns {boolean} - True if the string is a rejected topic, false otherwise.
|
|
33
|
-
*/
|
|
34
6
|
export declare const isRejectedDateTimeInfo: (str: string) => boolean;
|
|
@@ -8,75 +8,17 @@ const helpers_1 = require("./helpers");
|
|
|
8
8
|
const TitleSummaryMatchingPatterns_Time_json_1 = __importDefault(require("../../data/TitleSummaryMatchingPatterns_Time.json"));
|
|
9
9
|
const TitleSummaryRejectedPatterns_json_1 = __importDefault(require("../../data/TitleSummaryRejectedPatterns.json"));
|
|
10
10
|
const createWordBoundaryRegex_1 = require("../util/createWordBoundaryRegex");
|
|
11
|
-
/**
|
|
12
|
-
* Match time intervals relative to the present moment rather than specifying an absolute date or time
|
|
13
|
-
* - `\b`: Word boundary to ensure we match whole words and not substrings.
|
|
14
|
-
* - `(?:(last|past|next|current|latest|every)\s+)?`: A non-capturing group to optionally match words like "last", "past", "next", "current", "latest", and "every" followed by one or more spaces (\s+). The ? at the end makes this group optional.
|
|
15
|
-
* - `(\d+)?`: An optional capturing group to match one or more digits. This covers patterns like "7", "14", "48", etc.
|
|
16
|
-
* - `\s*`: Zero or more spaces. This handles cases where there might or might not be spaces between the number and the time unit.
|
|
17
|
-
* - `(year|month|week|day|hour|minute)s?`: A capturing group to match the time units: "year", "quarter", "month", "week", "day", "hour", and "minute". The s? makes the "s" optional to handle both singular and plural forms (e.g., "day" and "days").
|
|
18
|
-
*/
|
|
19
11
|
const relativeDateTimeRegex = /\b(?:(last|past|next|current|latest|every)\s+)(\d+)?\s*(year|month|week|day|hour|minute|quarter|calendar year)s?\b/gi;
|
|
20
|
-
/**
|
|
21
|
-
* A regular expression that matches time duration: e.g. '10-months', '5 Year', '3 hours'
|
|
22
|
-
*/
|
|
23
12
|
const timeDurationRegEx = /\b(\d+)(?:-)?\s*(year|month|week|day|hour|minute)s?\b/gi;
|
|
24
|
-
/**
|
|
25
|
-
* A regular expression that matches patterns like "3-5 years".
|
|
26
|
-
* Here's a breakdown of the regular expression:
|
|
27
|
-
*
|
|
28
|
-
* - `\b`: Word boundary to ensure we match whole words and not substrings.
|
|
29
|
-
* - `(\d+)`: A capturing group to match one or more digits.
|
|
30
|
-
* - `\s*`: Zero or more spaces.
|
|
31
|
-
* - `(?:-|to)`: A non-capturing group to match a hyphen (-) or the word "to".
|
|
32
|
-
* - `\s*`: Zero or more spaces.
|
|
33
|
-
* - `(\d+)`: A capturing group to match one or more digits.
|
|
34
|
-
* - `\s*`: Zero or more spaces.
|
|
35
|
-
* - `(year|month|week|day|hour|minute)s?`: A capturing group to match the time units: "year", "month", "week", "day", "hour", and "minute". The s? makes the "s" optional to handle both singular and plural forms (e.g., "day" and "days").
|
|
36
|
-
*/
|
|
37
13
|
const rangeWithUnitsRegEx = /\b(\d+)\s*(?:-|to)\s*(\d+)\s*(year|month|week|day|hour|minute)s?\b/gi;
|
|
38
|
-
/**
|
|
39
|
-
* A regular expression that matches year-related patterns, such as '2022', '2020-2024', '1950 to 2050', or 'present'.
|
|
40
|
-
*
|
|
41
|
-
* - `\b`: Word boundary to ensure whole word matches.
|
|
42
|
-
* - `(?:1[5-9]\d{2}|20\d{2}|21\d{2}|2200|present)`: Matches a year from 1500–1999, 2000–2099, 2100–2199, 2200, or the word "present".
|
|
43
|
-
* - `(?:\s*(?:-|and|to)\s*(?:1[5-9]\d{2}|20\d{2}|21\d{2}|2200|present))?`: Optionally matches a range connector ("-", "and", or "to") followed by another valid year or "present", allowing optional spaces.
|
|
44
|
-
* - `\b`: Word boundary to ensure whole word matches.
|
|
45
|
-
*/
|
|
46
14
|
const yearRangeRegEx = /\b(?:1[5-9]\d{2}|20\d{2}|21\d{2}|2200|present)(?:\s*(?:-|and|to)\s*(?:1[5-9]\d{2}|20\d{2}|21\d{2}|2200|present))?\b/gi;
|
|
47
|
-
/**
|
|
48
|
-
* A regular expression that matches month names and abbreviations.
|
|
49
|
-
* Matches full month names (e.g., January, February) and common abbreviations (e.g., Jan, Feb).
|
|
50
|
-
*/
|
|
51
15
|
const monthRegEx = /\b(?:january|february|march|april|may|june|july|august|september|october|november|december|jan|feb|mar|apr|jun|jul|aug|sep|sept|oct|nov|dec)\b/gi;
|
|
52
|
-
/**
|
|
53
|
-
* A regular expression that matches weekday names and abbreviations.
|
|
54
|
-
* Matches full weekday names (e.g., Monday, Tuesday) and common abbreviations (e.g., Mon, Tue).
|
|
55
|
-
*/
|
|
56
16
|
const weekdayRegEx = /\b(?:monday|tuesday|wednesday|thursday|friday|saturday|sunday|mon|tue|wed|thu|fri|sat|sun)\b/gi;
|
|
57
|
-
/**
|
|
58
|
-
* Match text like '20th century'
|
|
59
|
-
*/
|
|
60
17
|
const centuryRegEx = /\b(\d{1,2}(?:st|nd|rd|th)\s+century)\b/gi;
|
|
61
|
-
/**
|
|
62
|
-
* Additional patterns for matching date and time information.
|
|
63
|
-
* This includes phrases like 'once a day', 'monthly', 'daily', etc.
|
|
64
|
-
*/
|
|
65
18
|
const additionalPatterns = /\b(once\s+a\s+day|monthly|daily|hourly|weekly|bi-weekly|quarterly|semi-annually|annual|annually)\b/gi;
|
|
66
|
-
// const dateTimeMatchingPatterns = TitleSummaryMatchingPatterns.time;
|
|
67
19
|
const regex4DateTimeInfo = (0, createWordBoundaryRegex_1.createWordBoundaryRegex)(TitleSummaryMatchingPatterns_Time_json_1.default);
|
|
68
|
-
|
|
69
|
-
* Set of rejected date and time information.
|
|
70
|
-
*/
|
|
71
|
-
let rejectedDateTimeInfoSet = null; //new Set<string>(TitleSummaryMatchingPatterns.topics)
|
|
72
|
-
/**
|
|
73
|
-
* Regular expression to match additional date and time information.
|
|
74
|
-
*/
|
|
20
|
+
let rejectedDateTimeInfoSet = null;
|
|
75
21
|
let regexForExtraDateTimeInfo = null;
|
|
76
|
-
/**
|
|
77
|
-
* Create a set of rejected date and time information.
|
|
78
|
-
* @param extraRejectedPatternsForDateTimeInfo
|
|
79
|
-
*/
|
|
80
22
|
const createRejectedDateTimeInfoSet = (extraRejectedPatternsForDateTimeInfo = []) => {
|
|
81
23
|
rejectedDateTimeInfoSet = (0, helpers_1.toLowercaseSet)([
|
|
82
24
|
...TitleSummaryRejectedPatterns_json_1.default.common,
|
|
@@ -84,17 +26,6 @@ const createRejectedDateTimeInfoSet = (extraRejectedPatternsForDateTimeInfo = []
|
|
|
84
26
|
...extraRejectedPatternsForDateTimeInfo,
|
|
85
27
|
]);
|
|
86
28
|
};
|
|
87
|
-
/**
|
|
88
|
-
* Sets the extra matching patterns and rejected patterns for date-time information.
|
|
89
|
-
*
|
|
90
|
-
* @param extraMatchingPatterns - An array of strings representing the extra matching patterns.
|
|
91
|
-
* @param extraRejectedPatterns - An array of strings representing the extra rejected patterns.
|
|
92
|
-
* @param {boolean} [shouldAvoidUsingWordBoundary=false] - A boolean indicating whether to avoid using word boundaries (useful for languages like Chinese and Japanese).
|
|
93
|
-
*
|
|
94
|
-
* @remarks
|
|
95
|
-
* - For languages like Japanese that don't use spaces between words (or where word boundaries are not easily determined by spaces or punctuation),
|
|
96
|
-
* set `shouldAvoidUsingWordBoundary` to true to remove `\b` and use lookarounds to ensure correct boundaries.
|
|
97
|
-
*/
|
|
98
29
|
const setExtraDateTimeInfoMatchingPatterns = (extraMatchingPatterns, extraRejectedPatterns, shouldAvoidUsingWordBoundary = false) => {
|
|
99
30
|
if (extraMatchingPatterns && extraMatchingPatterns.length) {
|
|
100
31
|
regexForExtraDateTimeInfo = (0, createWordBoundaryRegex_1.createWordBoundaryRegex)(extraMatchingPatterns, {
|
|
@@ -104,15 +35,7 @@ const setExtraDateTimeInfoMatchingPatterns = (extraMatchingPatterns, extraReject
|
|
|
104
35
|
createRejectedDateTimeInfoSet(extraRejectedPatterns);
|
|
105
36
|
};
|
|
106
37
|
exports.setExtraDateTimeInfoMatchingPatterns = setExtraDateTimeInfoMatchingPatterns;
|
|
107
|
-
/**
|
|
108
|
-
* Matches date and time information from the title and snippet of an item.
|
|
109
|
-
*
|
|
110
|
-
* @param {IItem} item - The item containing title and snippet to be matched against.
|
|
111
|
-
* @param {string[]} [customMatchingPattenrs] - Optional custom matching patterns to be included in the regex.
|
|
112
|
-
* @returns {string[]} - An array of matched date and time information strings.
|
|
113
|
-
*/
|
|
114
38
|
const matchDateTimeInfo = (item, customMatchingPattenrs) => {
|
|
115
|
-
// const regex = new RegExp(regex1, 'gi')
|
|
116
39
|
const title = item.title || '';
|
|
117
40
|
const snippet = item.snippet || '';
|
|
118
41
|
const regex4TimeInfo = [
|
|
@@ -125,28 +48,13 @@ const matchDateTimeInfo = (item, customMatchingPattenrs) => {
|
|
|
125
48
|
monthRegEx,
|
|
126
49
|
weekdayRegEx,
|
|
127
50
|
];
|
|
128
|
-
// console.log(dateInfoText, patternsFromTextLabelingData)
|
|
129
|
-
// regex4TimeInfo.push(patternsFromTextLabelingData);
|
|
130
51
|
const matchedByCommonTimePatterns = [];
|
|
131
52
|
const combined = `${title}\n${snippet}`;
|
|
132
53
|
for (const regex of regex4TimeInfo) {
|
|
133
|
-
// const matchedLocationsFromTitle: string[] = title.match(regex) || [];
|
|
134
|
-
// const matchedLocationsFromSnippet: string[] =
|
|
135
|
-
// snippet.match(regex) || [];
|
|
136
|
-
// for (const text of matchedLocationsFromTitle) {
|
|
137
|
-
// matchedByCommonTimePatterns.push(text);
|
|
138
|
-
// }
|
|
139
|
-
// for (const text of matchedLocationsFromSnippet) {
|
|
140
|
-
// matchedByCommonTimePatterns.push(text);
|
|
141
|
-
// }
|
|
142
54
|
const matches = combined.match(regex) || [];
|
|
143
55
|
for (const match of matches) {
|
|
144
56
|
matchedByCommonTimePatterns.push(match);
|
|
145
57
|
}
|
|
146
|
-
// const matched = [
|
|
147
|
-
// ...matchedLocationsFromTitle,
|
|
148
|
-
// ...matchedLocationsFromSnippet,
|
|
149
|
-
// ];
|
|
150
58
|
}
|
|
151
59
|
const matchResultsByCommonPatterns = matchedByCommonTimePatterns.map((matchedString) => ({
|
|
152
60
|
matchedString,
|
|
@@ -166,21 +74,8 @@ const matchDateTimeInfo = (item, customMatchingPattenrs) => {
|
|
|
166
74
|
...matchResultsByCommonPatterns,
|
|
167
75
|
...matchedByTerms,
|
|
168
76
|
]);
|
|
169
|
-
// if (!candidates.length) {
|
|
170
|
-
// return matchWithCustomPatterns(
|
|
171
|
-
// item,
|
|
172
|
-
// customMatchingPattenrs,
|
|
173
|
-
// RejectedDateTimeInfosSet
|
|
174
|
-
// );
|
|
175
|
-
// }
|
|
176
|
-
// return cleanUpMatchedResults(candidates);
|
|
177
77
|
};
|
|
178
78
|
exports.matchDateTimeInfo = matchDateTimeInfo;
|
|
179
|
-
/**
|
|
180
|
-
* Check if the provided string contains recognized date and time information.
|
|
181
|
-
* @param str - The string to check.
|
|
182
|
-
* @returns {boolean} - True if the string contains recognized date and time information, false otherwise.
|
|
183
|
-
*/
|
|
184
79
|
const isRecognizedDateTimeInfo = (str) => {
|
|
185
80
|
const dateTimeInfo = (0, exports.matchDateTimeInfo)({
|
|
186
81
|
title: str,
|
|
@@ -189,11 +84,6 @@ const isRecognizedDateTimeInfo = (str) => {
|
|
|
189
84
|
return dateTimeInfo.length > 0;
|
|
190
85
|
};
|
|
191
86
|
exports.isRecognizedDateTimeInfo = isRecognizedDateTimeInfo;
|
|
192
|
-
/**
|
|
193
|
-
* Determines if a given string is a rejected topic.
|
|
194
|
-
* @param str - The string to check.
|
|
195
|
-
* @returns {boolean} - True if the string is a rejected topic, false otherwise.
|
|
196
|
-
*/
|
|
197
87
|
const isRejectedDateTimeInfo = (str) => {
|
|
198
88
|
if (!rejectedDateTimeInfoSet) {
|
|
199
89
|
createRejectedDateTimeInfoSet();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"matchDateTimeInfo.js","sourceRoot":"","sources":["../../../src/lib/checkTitleAndSnippetSearchability/matchDateTimeInfo.ts"],"names":[],"mappings":";;;;;;AACA,uCAOmB;AACnB,+HAAyF;AACzF,qHAAwF;AACxF,6EAA0E;
|
|
1
|
+
{"version":3,"file":"matchDateTimeInfo.js","sourceRoot":"","sources":["../../../src/lib/checkTitleAndSnippetSearchability/matchDateTimeInfo.ts"],"names":[],"mappings":";;;;;;AACA,uCAOmB;AACnB,+HAAyF;AACzF,qHAAwF;AACxF,6EAA0E;AAU1E,MAAM,qBAAqB,GACvB,sHAAsH,CAAC;AAK3H,MAAM,iBAAiB,GACnB,yDAAyD,CAAC;AAe9D,MAAM,mBAAmB,GACrB,sEAAsE,CAAC;AAU3E,MAAM,cAAc,GAChB,uHAAuH,CAAC;AAM5H,MAAM,UAAU,GACZ,kJAAkJ,CAAC;AAMvJ,MAAM,YAAY,GACd,gGAAgG,CAAC;AAKrG,MAAM,YAAY,GAAG,0CAA0C,CAAC;AAMhE,MAAM,kBAAkB,GACpB,sGAAsG,CAAC;AAI3G,MAAM,kBAAkB,GAAG,IAAA,iDAAuB,EAAC,gDAAwB,CAAC,CAAC;AAK7E,IAAI,uBAAuB,GAAgB,IAAI,CAAC;AAKhD,IAAI,yBAAyB,GAAW,IAAI,CAAC;AAM7C,MAAM,6BAA6B,GAAG,CAClC,uCAAiD,EAAE,EACrD,EAAE;IACA,uBAAuB,GAAG,IAAA,wBAAc,EAAC;QACrC,GAAG,2CAA4B,CAAC,MAAM;QACtC,GAAG,2CAA4B,CAAC,IAAI;QACpC,GAAG,oCAAoC;KAC1C,CAAC,CAAC;AACP,CAAC,CAAC;AAaK,MAAM,oCAAoC,GAAG,CAChD,qBAA+B,EAC/B,qBAA+B,EAC/B,4BAA4B,GAAG,KAAK,EACt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E,kBAAkB;QACtC,aAAa,EAAE,yBAAyB;QACxC,WAAW,EAAE,sBAAsB;QACnC,WAAW,EAAE,uBAAuB;KACvC,CAAC,CAAC;IAEH,OAAO,IAAA,+BAAqB,EAAC;QACzB,GAAG,4BAA4B;QAC/B,GAAG,cAAc;KACpB,CAAC,CAAC;AAWP,CAAC,CAAC;AApFW,QAAA,iBAAiB,qBAoF5B;AAOK,MAAM,wBAAwB,GAAG,CAAC,GAAW,EAAW,EAAE;IAC7D,MAAM,YAAY,GAAG,IAAA,yBAAiB,EAAC;QACnC,KAAK,EAAE,GAAG;QACV,OAAO,EAAE,EAAE;KACL,CAAC,CAAC;IAEZ,OAAO,YAAY,CAAC,MAAM,GAAG,CAAC,CAAC;AACnC,CAAC,CAAC;AAPW,QAAA,wBAAwB,4BAOnC;AAOK,MAAM,sBAAsB,GAAG,CAAC,GAAW,EAAW,EAAE;IAC3D,IAAI,CAAC,uBAAuB,EAAE,CAAC;QAC3B,6BAA6B,EAAE,CAAC;IACpC,CAAC;IAED,OAAO,IAAA,sBAAY,EAAC,GAAG,EAAE,uBAAuB,CAAC,CAAC;AACtD,CAAC,CAAC;AANW,QAAA,sBAAsB,0BAMjC"}
|
|
@@ -1,34 +1,6 @@
|
|
|
1
1
|
import { IItem } from '../../types';
|
|
2
2
|
import { MatchResult } from './helpers';
|
|
3
|
-
/**
|
|
4
|
-
* Sets extra matching and rejected patterns for locations and updates the corresponding regex and sets.
|
|
5
|
-
*
|
|
6
|
-
* @param extraMatchingPatternsForLocations - An array of strings representing additional patterns to match locations.
|
|
7
|
-
* @param extraRejectedPatternsForLocations - An array of strings representing additional patterns to reject locations.
|
|
8
|
-
* @param {boolean} [shouldAvoidUsingWordBoundary=false] - A boolean indicating whether to avoid using word boundaries (useful for languages like Chinese and Japanese).
|
|
9
|
-
*
|
|
10
|
-
* @remarks
|
|
11
|
-
* - For languages like Japanese that don't use spaces between words (or where word boundaries are not easily determined by spaces or punctuation),
|
|
12
|
-
* set `shouldAvoidUsingWordBoundary` to true to remove `\b` and use lookarounds to ensure correct boundaries.
|
|
13
|
-
*/
|
|
14
3
|
export declare const setExtraMatchingPatternsForLocations: (extraMatchingPatternsForLocations?: string[], extraRejectedPatternsForLocations?: string[], shouldAvoidUsingWordBoundary?: boolean) => void;
|
|
15
|
-
/**
|
|
16
|
-
* Matches location information from an item's title and snippet using predefined or custom matching patterns.
|
|
17
|
-
*
|
|
18
|
-
* @param {IItem} item - The item containing title and snippet to search for location information.
|
|
19
|
-
* @param {string[]} [customMatchingPattenrs] - Optional custom matching patterns to be included in the search.
|
|
20
|
-
* @returns {string[]} - An array of matched results for location info after deduplication and removing overlaps.
|
|
21
|
-
*/
|
|
22
4
|
export declare const matchLocationInfo: (item: IItem, customMatchingPattenrs?: string[]) => MatchResult[];
|
|
23
|
-
/**
|
|
24
|
-
* Determines if a given string is a recognized location information.
|
|
25
|
-
* @param topic - The string to check.
|
|
26
|
-
* @returns {boolean} - True if the string is a recognized location, false otherwise.
|
|
27
|
-
*/
|
|
28
5
|
export declare const isRecognizedLocation: (str: string) => boolean;
|
|
29
|
-
/**
|
|
30
|
-
* Determines if a given string is a rejected source information.
|
|
31
|
-
* @param str - The string to check.
|
|
32
|
-
* @returns {boolean} - True if the string is a rejected source information, false otherwise.
|
|
33
|
-
*/
|
|
34
6
|
export declare const isRejectedLocationInfo: (str: string) => boolean;
|