Text.PCLT.MakeCatalog
Description
A module around comlex function _readPCLTCatalog.
- type Parsed_DidWe = Bool
- data ReadPCSCatalogError
- = CompositionCycle_RPCSCE CompositionCycle_PCLTE
- | RequiredCompositeIsMissing_RPCSCE RequiredByRequirerCompositeIsMissing_PCLTE
- | RequiredCompositeIsUnparsable_RPCSCE RequirerCompositeKey RequiredCompositeKey
- | ParseFailedForDefaultLng_RPCSCE PCLT_CompositeKey Parsed_DidWe [PCLT_ParserLowLevelFailure]
- | TplDefaultLngIsMissing_RPCSCE TplDefaultLngIsMissing_PCLTE
- | ParseFailedForNondefaultLng_RPCSCE PCLT_CompositeKey Parsed_DidWe LanguageName [PCLT_ParserLowLevelFailure]
- | DefaultLngTplComponentsParamsSetsDiffersFromOnesOfNondefault_RPCSCE DefaultLngTplComponentsParamsSetsDiffersFromOnesOfNondefault_PCLTE
- | DifferentSDLs_RPCSCE DifferentSDLs_PCLTE
- | TplUniquenessViol_RPCSCE TplUniquenessViol_PCLTE
- | SDL_ToCompositeLinkRefsToNonexistent_RPCSCE RequirerCompositeKey RequiredCompositeKey
- | DRL_NormalizationError_RPCSCE DRL_NormalizationError
- readPCLTCatalog :: PCLT_InnerConfig -> PCLT_CatalogID -> PCLT_RawCatalogData -> (PCLT_Catalog, [ErrorWithPCSCatalog ReadPCSCatalogError])
- _readPCLTCatalog :: (PCLT_Catalog, [ReadPCSCatalogError]) -> PCLT_RawCatalogData -> (PCLT_Catalog, [ErrorWithPCSCatalog ReadPCSCatalogError])
- data DRL_NormalizationError
- normalizeReferentialSDLs :: PCLT_CatalogMap -> (PCLT_CatalogMap, [DRL_NormalizationError])
- data AHSTR2LngTpl_Error
- adhoc_str2ldt :: (ByteString, LanguageName) -> PCLT_Catalog -> Either AHSTR2LngTpl_Error LocalizedTemplate
- str2pclt :: (PCLT_ID, PCLT_AllocatedShowDetalizationLevel) -> (LanguageName, ByteString) -> PCLT_Catalog -> Either (ErrorWithPCSCatalog ReadPCSCatalogError) LocalizableTemplate
- str_list2pclt :: (PCLT_ID, PCLT_AllocatedShowDetalizationLevel) -> Map LanguageName ByteString -> PCLT_Catalog -> (LocalizableTemplate, [ErrorWithPCSCatalog ReadPCSCatalogError])
Documentation
type Parsed_DidWe = BoolSource
data ReadPCSCatalogError Source
Error type for _readPCLTCatalog.
Descriptios for some value constructors:
-
DefaultLngTplComponentsParamsSetsDiffersFromOnesOfNondefault_RPCSCE: For more information about this error seeStrictOrient_ofParamsAndCmpsts_onDfltLngTplsSets -
DifferentSDLs_RPCSCE: This may occur in case when somePCLT_RawCatalogDatais added to a nonemptyPCLT_Catalog, and same templates in both places has different SDL requirements. -
TplUniquenessViol_RPCSCE: This may occur in case when somePCLT_RawCatalogDatais added to a nonemptyPCLT_Catalog, and there isan intersection between their {(Template ID, Language)} sets. -
SDL_ToCompositeLinkRefsToNonexistent_RPCSCE: SDL requirement specification (pcltRequiredSDL) for a template is of typePCLT_SDL_ToTemplateLinkand references to a template which is not persistant in catalog or raw input data.
Constructors
readPCLTCatalog :: PCLT_InnerConfig -> PCLT_CatalogID -> PCLT_RawCatalogData -> (PCLT_Catalog, [ErrorWithPCSCatalog ReadPCSCatalogError])Source
Wrapper around _readPCLTCatalog. To be used when starting with an empty catalog.
_readPCLTCatalog :: (PCLT_Catalog, [ReadPCSCatalogError]) -> PCLT_RawCatalogData -> (PCLT_Catalog, [ErrorWithPCSCatalog ReadPCSCatalogError])Source
Take a bunch of raw templates, parse them into normal templates and add them to a catalog.
data DRL_NormalizationError Source
Error type for normalizeReferentialSDLs.
normalizeReferentialSDLs :: PCLT_CatalogMap -> (PCLT_CatalogMap, [DRL_NormalizationError])Source
Under "Referential SDLs normalization" here is understood the following. Now consider paths like:
Tpl_1.pcltRequiredSDL-> Tpl_2.pcltRequiredSDL
which means pcltRequiredSDL of Tpl_1 is specified (using
PCLT_SDL_ToTemplateLink) to be the same as for Tpl_2. Here we can
reduce the PCLT_SDL_ToTemplateLink of Tpl_1 by assinging instead of it
Tpl_2.pcltRequiredSDL value. Data consistency is respected. We win in
speed of Tpl_1.pcltRequiredSDL determination. The negative side of this,
is that we can't change Tpl_2.pcltRequiredSDL anymore without spoiling
data consistency. That's another reason why a PCLT catalog is so hard to
modify. Perhaps the problem will be solved in future versions of PCLT.
So this function reduces all PCLT_SDL_ToTemplateLinks in a given
PCLT_CatalogMap, BUT, only where they lead to PCLT_SDLs or
to other PCLT_SDL_ToTemplateLinks (which recursively gets considered
to be reduced), not when it leads to PCLT_SDL_ToParamCompositeLink
or PCLT_SDL_Errornous.
data AHSTR2LngTpl_Error Source
Error type for adhoc_str2ldt.
adhoc_str2ldt :: (ByteString, LanguageName) -> PCLT_Catalog -> Either AHSTR2LngTpl_Error LocalizedTemplateSource
Make a LocalizedTemplate
out of a single ByteString.
str2pclt :: (PCLT_ID, PCLT_AllocatedShowDetalizationLevel) -> (LanguageName, ByteString) -> PCLT_Catalog -> Either (ErrorWithPCSCatalog ReadPCSCatalogError) LocalizableTemplateSource
Make a LocalizableTemplate
out of a single ByteString.
str_list2pclt :: (PCLT_ID, PCLT_AllocatedShowDetalizationLevel) -> Map LanguageName ByteString -> PCLT_Catalog -> (LocalizableTemplate, [ErrorWithPCSCatalog ReadPCSCatalogError])Source
Make a LocalizableTemplate out of list
of ByteStrings.