@natlibfi/marc-record-validators-melinda 3.2.0 → 3.3.14-alpha.3
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/.github/CODEOWNERS +2 -0
- package/.github/dependabot.yml +40 -0
- package/.github/workflows/melinda-node-tests.yml +61 -0
- package/LICENSE.txt +21 -661
- package/README.md +4 -5
- package/dist/access-rights.js +94 -0
- package/dist/access-rights.js.map +1 -0
- package/dist/access-rights.spec.js +150 -0
- package/dist/access-rights.spec.js.map +1 -0
- package/dist/double-commas.js +17 -27
- package/dist/double-commas.js.map +1 -1
- package/dist/double-commas.spec.js +72 -27
- package/dist/double-commas.spec.js.map +1 -1
- package/dist/duplicates-ind1.js +47 -27
- package/dist/duplicates-ind1.js.map +1 -1
- package/dist/duplicates-ind1.spec.js +44 -27
- package/dist/duplicates-ind1.spec.js.map +1 -1
- package/dist/empty-fields.js +79 -29
- package/dist/empty-fields.js.map +1 -1
- package/dist/empty-fields.spec.js +113 -27
- package/dist/empty-fields.spec.js.map +1 -1
- package/dist/ending-punctuation-conf.js +772 -129
- package/dist/ending-punctuation-conf.js.map +1 -1
- package/dist/ending-punctuation.js +291 -72
- package/dist/ending-punctuation.js.map +1 -1
- package/dist/ending-punctuation.spec.js +2638 -118
- package/dist/ending-punctuation.spec.js.map +1 -1
- package/dist/ending-whitespace.js +58 -0
- package/dist/ending-whitespace.js.map +1 -0
- package/dist/ending-whitespace.spec.js +42 -0
- package/dist/ending-whitespace.spec.js.map +1 -0
- package/dist/field-521-fix.js +96 -0
- package/dist/field-521-fix.js.map +1 -0
- package/dist/field-521-fix.spec.js +51 -0
- package/dist/field-521-fix.spec.js.map +1 -0
- package/dist/field-exclusion.js +214 -63
- package/dist/field-exclusion.js.map +1 -1
- package/dist/field-exclusion.spec.js +1057 -31
- package/dist/field-exclusion.spec.js.map +1 -1
- package/dist/field-structure.js +249 -78
- package/dist/field-structure.js.map +1 -1
- package/dist/field-structure.spec.js +534 -31
- package/dist/field-structure.spec.js.map +1 -1
- package/dist/fields-present.js +31 -27
- package/dist/fields-present.js.map +1 -1
- package/dist/fields-present.spec.js +120 -27
- package/dist/fields-present.spec.js.map +1 -1
- package/dist/fixed-fields.js +72 -27
- package/dist/fixed-fields.js.map +1 -1
- package/dist/fixed-fields.spec.js +139 -27
- package/dist/fixed-fields.spec.js.map +1 -1
- package/dist/identical-fields.js +42 -28
- package/dist/identical-fields.js.map +1 -1
- package/dist/identical-fields.spec.js +98 -27
- package/dist/identical-fields.spec.js.map +1 -1
- package/dist/index.js +202 -27
- package/dist/index.js.map +1 -1
- package/dist/indicator-fixes.js +191 -0
- package/dist/indicator-fixes.js.map +1 -0
- package/dist/indicator-fixes.spec.js +51 -0
- package/dist/indicator-fixes.spec.js.map +1 -0
- package/dist/isbn-issn.js +266 -27
- package/dist/isbn-issn.js.map +1 -1
- package/dist/isbn-issn.spec.js +594 -27
- package/dist/isbn-issn.spec.js.map +1 -1
- package/dist/item-language.js +171 -27
- package/dist/item-language.js.map +1 -1
- package/dist/item-language.spec.js +305 -27
- package/dist/item-language.spec.js.map +1 -1
- package/dist/mergeField500Lisapainokset.js +155 -0
- package/dist/mergeField500Lisapainokset.js.map +1 -0
- package/dist/mergeField500Lisapainokset.spec.js +51 -0
- package/dist/mergeField500Lisapainokset.spec.js.map +1 -0
- package/dist/mergeRelatorTermFields.js +140 -0
- package/dist/mergeRelatorTermFields.js.map +1 -0
- package/dist/mergeRelatorTermFields.spec.js +51 -0
- package/dist/mergeRelatorTermFields.spec.js.map +1 -0
- package/dist/multiple-subfield-0.js +120 -0
- package/dist/multiple-subfield-0.js.map +1 -0
- package/dist/multiple-subfield-0.spec.js +51 -0
- package/dist/multiple-subfield-0.spec.js.map +1 -0
- package/dist/non-breaking-space.js +61 -0
- package/dist/non-breaking-space.js.map +1 -0
- package/dist/non-breaking-space.spec.js +42 -0
- package/dist/non-breaking-space.spec.js.map +1 -0
- package/dist/normalize-identifiers.js +210 -0
- package/dist/normalize-identifiers.js.map +1 -0
- package/dist/normalize-identifiers.spec.js +51 -0
- package/dist/normalize-identifiers.spec.js.map +1 -0
- package/dist/normalize-utf8-diacritics.js +140 -0
- package/dist/normalize-utf8-diacritics.js.map +1 -0
- package/dist/normalize-utf8-diacritics.spec.js +51 -0
- package/dist/normalize-utf8-diacritics.spec.js.map +1 -0
- package/dist/punctuation/index.js +281 -0
- package/dist/punctuation/index.js.map +1 -0
- package/dist/punctuation/rules/aut.js +332 -0
- package/dist/punctuation/rules/aut.js.map +1 -0
- package/dist/punctuation/rules/bib.js +374 -0
- package/dist/punctuation/rules/bib.js.map +1 -0
- package/dist/punctuation/rules/index.js +21 -0
- package/dist/punctuation/rules/index.js.map +1 -0
- package/dist/punctuation.spec.js +51 -0
- package/dist/punctuation.spec.js.map +1 -0
- package/dist/punctuation2.js +726 -0
- package/dist/punctuation2.js.map +1 -0
- package/dist/punctuation2.spec.js +51 -0
- package/dist/punctuation2.spec.js.map +1 -0
- package/dist/reindexSubfield6OccurenceNumbers.js +199 -0
- package/dist/reindexSubfield6OccurenceNumbers.js.map +1 -0
- package/dist/reindexSubfield6OccurenceNumbers.spec.js +51 -0
- package/dist/reindexSubfield6OccurenceNumbers.spec.js.map +1 -0
- package/dist/removeDuplicateDataFields.js +405 -0
- package/dist/removeDuplicateDataFields.js.map +1 -0
- package/dist/removeDuplicateDataFields.spec.js +51 -0
- package/dist/removeDuplicateDataFields.spec.js.map +1 -0
- package/dist/removeInferiorDataFields.js +245 -0
- package/dist/removeInferiorDataFields.js.map +1 -0
- package/dist/removeInferiorDataFields.spec.js +51 -0
- package/dist/removeInferiorDataFields.spec.js.map +1 -0
- package/dist/resolvable-ext-references-melinda.js +112 -31
- package/dist/resolvable-ext-references-melinda.js.map +1 -1
- package/dist/resolvable-ext-references-melinda.spec.js +166 -27
- package/dist/resolvable-ext-references-melinda.spec.js.map +1 -1
- package/dist/resolveOrphanedSubfield6s.js +116 -0
- package/dist/resolveOrphanedSubfield6s.js.map +1 -0
- package/dist/resolveOrphanedSubfield6s.spec.js +51 -0
- package/dist/resolveOrphanedSubfield6s.spec.js.map +1 -0
- package/dist/sanitize-vocabulary-source-codes.js +93 -0
- package/dist/sanitize-vocabulary-source-codes.js.map +1 -0
- package/dist/sanitize-vocabulary-source-codes.spec.js +51 -0
- package/dist/sanitize-vocabulary-source-codes.spec.js.map +1 -0
- package/dist/sort-tags.js +53 -27
- package/dist/sort-tags.js.map +1 -1
- package/dist/sort-tags.spec.js +206 -27
- package/dist/sort-tags.spec.js.map +1 -1
- package/dist/sortRelatorTerms.js +135 -0
- package/dist/sortRelatorTerms.js.map +1 -0
- package/dist/sortRelatorTerms.spec.js +51 -0
- package/dist/sortRelatorTerms.spec.js.map +1 -0
- package/dist/sortSubfields.js +279 -0
- package/dist/sortSubfields.js.map +1 -0
- package/dist/sortSubfields.spec.js +51 -0
- package/dist/sortSubfields.spec.js.map +1 -0
- package/dist/stripPunctuation.js +49 -0
- package/dist/stripPunctuation.js.map +1 -0
- package/dist/stripPunctuation.spec.js +51 -0
- package/dist/stripPunctuation.spec.js.map +1 -0
- package/dist/subfield-exclusion.js +174 -57
- package/dist/subfield-exclusion.js.map +1 -1
- package/dist/subfield-exclusion.spec.js +521 -31
- package/dist/subfield-exclusion.spec.js.map +1 -1
- package/dist/subfield6Utils.js +457 -0
- package/dist/subfield6Utils.js.map +1 -0
- package/dist/subfield8Utils.js +99 -0
- package/dist/subfield8Utils.js.map +1 -0
- package/dist/typeOfDate-008.js +48 -0
- package/dist/typeOfDate-008.js.map +1 -0
- package/dist/typeOfDate-008.spec.js +47 -0
- package/dist/typeOfDate-008.spec.js.map +1 -0
- package/dist/unicode-decomposition.js +139 -30
- package/dist/unicode-decomposition.js.map +1 -1
- package/dist/unicode-decomposition.spec.js +90 -27
- package/dist/unicode-decomposition.spec.js.map +1 -1
- package/dist/update-field-540.js +119 -0
- package/dist/update-field-540.js.map +1 -0
- package/dist/update-field-540.spec.js +51 -0
- package/dist/update-field-540.spec.js.map +1 -0
- package/dist/urn.js +185 -0
- package/dist/urn.js.map +1 -0
- package/dist/urn.spec.js +238 -0
- package/dist/urn.spec.js.map +1 -0
- package/dist/utils.js +58 -0
- package/dist/utils.js.map +1 -0
- package/package.json +114 -124
- package/src/access-rights.js +84 -0
- package/src/access-rights.spec.js +126 -0
- package/src/double-commas.js +12 -49
- package/src/double-commas.spec.js +50 -82
- package/src/duplicates-ind1.js +34 -74
- package/src/duplicates-ind1.spec.js +39 -117
- package/src/empty-fields.js +62 -74
- package/src/empty-fields.spec.js +134 -207
- package/src/ending-punctuation-conf.js +679 -644
- package/src/ending-punctuation.js +260 -250
- package/src/ending-punctuation.spec.js +2545 -2322
- package/src/ending-whitespace.js +40 -0
- package/src/ending-whitespace.spec.js +44 -0
- package/src/field-521-fix.js +92 -0
- package/src/field-521-fix.spec.js +52 -0
- package/src/field-exclusion.js +197 -215
- package/src/field-exclusion.spec.js +883 -481
- package/src/field-structure.js +213 -271
- package/src/field-structure.spec.js +597 -474
- package/src/fields-present.js +19 -49
- package/src/fields-present.spec.js +90 -91
- package/src/fixed-fields.js +61 -94
- package/src/fixed-fields.spec.js +81 -125
- package/src/identical-fields.js +29 -48
- package/src/identical-fields.spec.js +114 -146
- package/src/index.js +41 -46
- package/src/indicator-fixes.js +211 -0
- package/src/indicator-fixes.spec.js +52 -0
- package/src/isbn-issn.js +254 -106
- package/src/isbn-issn.spec.js +399 -172
- package/src/item-language.js +158 -195
- package/src/item-language.spec.js +314 -306
- package/src/mergeField500Lisapainokset.js +153 -0
- package/src/mergeField500Lisapainokset.spec.js +52 -0
- package/src/mergeRelatorTermFields.js +143 -0
- package/src/mergeRelatorTermFields.spec.js +52 -0
- package/src/multiple-subfield-0.js +129 -0
- package/src/multiple-subfield-0.spec.js +52 -0
- package/src/non-breaking-space.js +49 -0
- package/src/non-breaking-space.spec.js +44 -0
- package/src/normalize-identifiers.js +197 -0
- package/src/normalize-identifiers.spec.js +52 -0
- package/src/normalize-utf8-diacritics.js +141 -0
- package/src/normalize-utf8-diacritics.spec.js +52 -0
- package/src/punctuation/index.js +292 -0
- package/src/punctuation/rules/aut.js +372 -0
- package/src/punctuation/rules/bib.js +420 -0
- package/src/punctuation/rules/index.js +7 -0
- package/src/punctuation.spec.js +52 -0
- package/src/punctuation2.js +441 -0
- package/src/punctuation2.spec.js +52 -0
- package/src/reindexSubfield6OccurenceNumbers.js +210 -0
- package/src/reindexSubfield6OccurenceNumbers.spec.js +52 -0
- package/src/removeDuplicateDataFields.js +447 -0
- package/src/removeDuplicateDataFields.spec.js +52 -0
- package/src/removeInferiorDataFields.js +259 -0
- package/src/removeInferiorDataFields.spec.js +52 -0
- package/src/resolvable-ext-references-melinda.js +89 -122
- package/src/resolvable-ext-references-melinda.spec.js +168 -198
- package/src/resolveOrphanedSubfield6s.js +115 -0
- package/src/resolveOrphanedSubfield6s.spec.js +52 -0
- package/src/sanitize-vocabulary-source-codes.js +99 -0
- package/src/sanitize-vocabulary-source-codes.spec.js +52 -0
- package/src/sort-tags.js +34 -60
- package/src/sort-tags.spec.js +256 -290
- package/src/sortRelatorTerms.js +142 -0
- package/src/sortRelatorTerms.spec.js +52 -0
- package/src/sortSubfields.js +176 -0
- package/src/sortSubfields.spec.js +52 -0
- package/src/stripPunctuation.js +42 -0
- package/src/stripPunctuation.spec.js +52 -0
- package/src/subfield-exclusion.js +157 -180
- package/src/subfield-exclusion.spec.js +507 -453
- package/src/subfield6Utils.js +485 -0
- package/src/subfield8Utils.js +102 -0
- package/src/typeOfDate-008.js +40 -0
- package/src/typeOfDate-008.spec.js +47 -0
- package/src/unicode-decomposition.js +130 -145
- package/src/unicode-decomposition.spec.js +89 -115
- package/src/update-field-540.js +99 -0
- package/src/update-field-540.spec.js +52 -0
- package/src/urn.js +164 -0
- package/src/urn.spec.js +231 -0
- package/src/utils.js +52 -0
- package/test-fixtures/duplicates-ind1/01/expectedResult.json +4 -0
- package/test-fixtures/duplicates-ind1/01/metadata.json +4 -0
- package/test-fixtures/duplicates-ind1/01/record.json +16 -0
- package/test-fixtures/duplicates-ind1/02/expectedResult.json +6 -0
- package/test-fixtures/duplicates-ind1/02/metadata.json +4 -0
- package/test-fixtures/duplicates-ind1/02/record.json +16 -0
- package/test-fixtures/duplicates-ind1/03/expectedResult.json +13 -0
- package/test-fixtures/duplicates-ind1/03/metadata.json +6 -0
- package/test-fixtures/duplicates-ind1/03/record.json +16 -0
- package/test-fixtures/ending-whitespace/01/expectedResult.json +4 -0
- package/test-fixtures/ending-whitespace/01/metadata.json +6 -0
- package/test-fixtures/ending-whitespace/01/record.json +15 -0
- package/test-fixtures/ending-whitespace/02/expectedResult.json +4 -0
- package/test-fixtures/ending-whitespace/02/metadata.json +6 -0
- package/test-fixtures/ending-whitespace/02/record.json +15 -0
- package/test-fixtures/ending-whitespace/03/expectedResult.json +17 -0
- package/test-fixtures/ending-whitespace/03/metadata.json +6 -0
- package/test-fixtures/ending-whitespace/03/record.json +15 -0
- package/test-fixtures/ending-whitespace/04/expectedResult.json +10 -0
- package/test-fixtures/ending-whitespace/04/metadata.json +6 -0
- package/test-fixtures/ending-whitespace/04/record.json +8 -0
- package/test-fixtures/fix521/01/expectedResult.json +6 -0
- package/test-fixtures/fix521/01/metadata.json +5 -0
- package/test-fixtures/fix521/01/record.json +13 -0
- package/test-fixtures/fix521/02/expectedResult.json +15 -0
- package/test-fixtures/fix521/02/metadata.json +5 -0
- package/test-fixtures/fix521/02/record.json +13 -0
- package/test-fixtures/fix521/03/expectedResult.json +5 -0
- package/test-fixtures/fix521/03/metadata.json +5 -0
- package/test-fixtures/fix521/03/record.json +13 -0
- package/test-fixtures/indicator-fixes/01/expectedResult.json +9 -0
- package/test-fixtures/indicator-fixes/01/metadata.json +5 -0
- package/test-fixtures/indicator-fixes/01/record.json +64 -0
- package/test-fixtures/indicator-fixes/02/expectedResult.json +66 -0
- package/test-fixtures/indicator-fixes/02/metadata.json +5 -0
- package/test-fixtures/indicator-fixes/02/record.json +64 -0
- package/test-fixtures/indicator-fixes/03/expectedResult.json +55 -0
- package/test-fixtures/indicator-fixes/03/metadata.json +5 -0
- package/test-fixtures/indicator-fixes/03/record.json +54 -0
- package/test-fixtures/indicator-fixes/04/expectedResult.json +66 -0
- package/test-fixtures/indicator-fixes/04/metadata.json +5 -0
- package/test-fixtures/indicator-fixes/04/record.json +65 -0
- package/test-fixtures/indicator-fixes/05/expectedResult.json +66 -0
- package/test-fixtures/indicator-fixes/05/metadata.json +5 -0
- package/test-fixtures/indicator-fixes/05/record.json +65 -0
- package/test-fixtures/indicator-fixes/06/expectedResult.json +75 -0
- package/test-fixtures/indicator-fixes/06/metadata.json +5 -0
- package/test-fixtures/indicator-fixes/06/record.json +74 -0
- package/test-fixtures/lisapainokset/fixer/01/expectedResult.json +37 -0
- package/test-fixtures/lisapainokset/fixer/01/metadata.json +6 -0
- package/test-fixtures/lisapainokset/fixer/01/record.json +61 -0
- package/test-fixtures/lisapainokset/fixer/02/expectedResult.json +44 -0
- package/test-fixtures/lisapainokset/fixer/02/metadata.json +6 -0
- package/test-fixtures/lisapainokset/fixer/02/record.json +45 -0
- package/test-fixtures/lisapainokset/fixer/03/expectedResult.json +21 -0
- package/test-fixtures/lisapainokset/fixer/03/metadata.json +6 -0
- package/test-fixtures/lisapainokset/fixer/03/record.json +45 -0
- package/test-fixtures/lisapainokset/validator/01/expectedResult.json +7 -0
- package/test-fixtures/lisapainokset/validator/01/metadata.json +6 -0
- package/test-fixtures/lisapainokset/validator/01/record.json +45 -0
- package/test-fixtures/lisapainokset/validator/02/expectedResult.json +6 -0
- package/test-fixtures/lisapainokset/validator/02/metadata.json +6 -0
- package/test-fixtures/lisapainokset/validator/02/record.json +61 -0
- package/test-fixtures/lisapainokset/validator/03/expectedResult.json +4 -0
- package/test-fixtures/lisapainokset/validator/03/metadata.json +6 -0
- package/test-fixtures/lisapainokset/validator/03/record.json +37 -0
- package/test-fixtures/mergeRelatorTermFields/fixer/01/expectedResult.json +14 -0
- package/test-fixtures/mergeRelatorTermFields/fixer/01/metadata.json +6 -0
- package/test-fixtures/mergeRelatorTermFields/fixer/01/record.json +16 -0
- package/test-fixtures/mergeRelatorTermFields/fixer/02/expectedResult.json +17 -0
- package/test-fixtures/mergeRelatorTermFields/fixer/02/metadata.json +6 -0
- package/test-fixtures/mergeRelatorTermFields/fixer/02/record.json +23 -0
- package/test-fixtures/mergeRelatorTermFields/validator/01/expectedResult.json +6 -0
- package/test-fixtures/mergeRelatorTermFields/validator/01/metadata.json +6 -0
- package/test-fixtures/mergeRelatorTermFields/validator/01/record.json +16 -0
- package/test-fixtures/mergeRelatorTermFields/validator/02/expectedResult.json +4 -0
- package/test-fixtures/mergeRelatorTermFields/validator/02/metadata.json +6 -0
- package/test-fixtures/mergeRelatorTermFields/validator/02/record.json +16 -0
- package/test-fixtures/non-breaking-space/01/expectedResult.json +4 -0
- package/test-fixtures/non-breaking-space/01/metadata.json +6 -0
- package/test-fixtures/non-breaking-space/01/record.json +15 -0
- package/test-fixtures/non-breaking-space/02/expectedResult.json +4 -0
- package/test-fixtures/non-breaking-space/02/metadata.json +6 -0
- package/test-fixtures/non-breaking-space/02/record.json +15 -0
- package/test-fixtures/non-breaking-space/03/expectedResult.json +17 -0
- package/test-fixtures/non-breaking-space/03/metadata.json +6 -0
- package/test-fixtures/non-breaking-space/03/record.json +15 -0
- package/test-fixtures/non-breaking-space/04/expectedResult.json +21 -0
- package/test-fixtures/non-breaking-space/04/metadata.json +6 -0
- package/test-fixtures/non-breaking-space/04/record.json +19 -0
- package/test-fixtures/normalize-identifiers/01/expectedResult.json +8 -0
- package/test-fixtures/normalize-identifiers/01/metadata.json +5 -0
- package/test-fixtures/normalize-identifiers/01/record.json +81 -0
- package/test-fixtures/normalize-identifiers/02/expectedResult.json +92 -0
- package/test-fixtures/normalize-identifiers/02/metadata.json +5 -0
- package/test-fixtures/normalize-identifiers/02/record.json +92 -0
- package/test-fixtures/normalize-identifiers/03/expectedResult.json +63 -0
- package/test-fixtures/normalize-identifiers/03/metadata.json +5 -0
- package/test-fixtures/normalize-identifiers/03/record.json +61 -0
- package/test-fixtures/normalize-identifiers/04/expectedResult.json +79 -0
- package/test-fixtures/normalize-identifiers/04/metadata.json +5 -0
- package/test-fixtures/normalize-identifiers/04/record.json +77 -0
- package/test-fixtures/normalize-utf8-diacritics/01/expectedResult.json +7 -0
- package/test-fixtures/normalize-utf8-diacritics/01/metadata.json +5 -0
- package/test-fixtures/normalize-utf8-diacritics/01/record.json +39 -0
- package/test-fixtures/normalize-utf8-diacritics/02/expectedResult.json +41 -0
- package/test-fixtures/normalize-utf8-diacritics/02/metadata.json +5 -0
- package/test-fixtures/normalize-utf8-diacritics/02/record.json +39 -0
- package/test-fixtures/normalize-utf8-diacritics/03/expectedResult.json +5 -0
- package/test-fixtures/normalize-utf8-diacritics/03/metadata.json +5 -0
- package/test-fixtures/normalize-utf8-diacritics/03/record.json +37 -0
- package/test-fixtures/normalize-utf8-diacritics/04/expectedResult.json +41 -0
- package/test-fixtures/normalize-utf8-diacritics/04/metadata.json +5 -0
- package/test-fixtures/normalize-utf8-diacritics/04/record.json +39 -0
- package/test-fixtures/normalize-utf8-diacritics/05/expectedResult.json +41 -0
- package/test-fixtures/normalize-utf8-diacritics/05/metadata.json +5 -0
- package/test-fixtures/normalize-utf8-diacritics/05/record.json +41 -0
- package/test-fixtures/punctuation/01/expectedResult.json +3 -0
- package/test-fixtures/punctuation/01/metadata.json +4 -0
- package/test-fixtures/punctuation/01/record.json +18 -0
- package/test-fixtures/punctuation/02/expectedResult.json +3 -0
- package/test-fixtures/punctuation/02/metadata.json +4 -0
- package/test-fixtures/punctuation/02/record.json +18 -0
- package/test-fixtures/punctuation/03/expectedResult.json +21 -0
- package/test-fixtures/punctuation/03/metadata.json +5 -0
- package/test-fixtures/punctuation/03/record.json +19 -0
- package/test-fixtures/punctuation/04/expectedResult.json +21 -0
- package/test-fixtures/punctuation/04/metadata.json +5 -0
- package/test-fixtures/punctuation/04/record.json +19 -0
- package/test-fixtures/punctuation/05/expectedResult.json +44 -0
- package/test-fixtures/punctuation/05/metadata.json +5 -0
- package/test-fixtures/punctuation/05/record.json +42 -0
- package/test-fixtures/punctuation2/01/expectedResult.json +12 -0
- package/test-fixtures/punctuation2/01/metadata.json +6 -0
- package/test-fixtures/punctuation2/01/record.json +37 -0
- package/test-fixtures/punctuation2/02/expectedResult.json +4 -0
- package/test-fixtures/punctuation2/02/metadata.json +6 -0
- package/test-fixtures/punctuation2/02/record.json +14 -0
- package/test-fixtures/punctuation2/04/expectedResult.json +7 -0
- package/test-fixtures/punctuation2/04/metadata.json +6 -0
- package/test-fixtures/punctuation2/04/record.json +22 -0
- package/test-fixtures/punctuation2/05/expectedResult.json +6 -0
- package/test-fixtures/punctuation2/05/metadata.json +6 -0
- package/test-fixtures/punctuation2/05/record.json +12 -0
- package/test-fixtures/punctuation2/98/expectedResult.json +45 -0
- package/test-fixtures/punctuation2/98/metadata.json +6 -0
- package/test-fixtures/punctuation2/98/record.json +43 -0
- package/test-fixtures/punctuation2/99/expectedResult.json +15 -0
- package/test-fixtures/punctuation2/99/metadata.json +6 -0
- package/test-fixtures/punctuation2/99/record.json +14 -0
- package/test-fixtures/reindex-sf6-occurence-numbers/f01/expectedResult.json +35 -0
- package/test-fixtures/reindex-sf6-occurence-numbers/f01/metadata.json +6 -0
- package/test-fixtures/reindex-sf6-occurence-numbers/f01/record.json +34 -0
- package/test-fixtures/reindex-sf6-occurence-numbers/f02/expectedResult.json +53 -0
- package/test-fixtures/reindex-sf6-occurence-numbers/f02/metadata.json +6 -0
- package/test-fixtures/reindex-sf6-occurence-numbers/f02/record.json +51 -0
- package/test-fixtures/reindex-sf6-occurence-numbers/f03/expectedResult.json +46 -0
- package/test-fixtures/reindex-sf6-occurence-numbers/f03/metadata.json +7 -0
- package/test-fixtures/reindex-sf6-occurence-numbers/f03/record.json +44 -0
- package/test-fixtures/reindex-sf6-occurence-numbers/v01/expectedResult.json +6 -0
- package/test-fixtures/reindex-sf6-occurence-numbers/v01/metadata.json +5 -0
- package/test-fixtures/reindex-sf6-occurence-numbers/v01/record.json +31 -0
- package/test-fixtures/reindex-sf6-occurence-numbers/v02/expectedResult.json +6 -0
- package/test-fixtures/reindex-sf6-occurence-numbers/v02/metadata.json +6 -0
- package/test-fixtures/reindex-sf6-occurence-numbers/v02/record.json +38 -0
- package/test-fixtures/reindex-sf6-occurence-numbers/v03/expectedResult.json +6 -0
- package/test-fixtures/reindex-sf6-occurence-numbers/v03/metadata.json +6 -0
- package/test-fixtures/reindex-sf6-occurence-numbers/v03/record.json +30 -0
- package/test-fixtures/remove-duplicate-datafields/f01/expectedResult.json +35 -0
- package/test-fixtures/remove-duplicate-datafields/f01/metadata.json +6 -0
- package/test-fixtures/remove-duplicate-datafields/f01/record.json +34 -0
- package/test-fixtures/remove-duplicate-datafields/f03/expectedResult.json +20 -0
- package/test-fixtures/remove-duplicate-datafields/f03/metadata.json +6 -0
- package/test-fixtures/remove-duplicate-datafields/f03/record.json +33 -0
- package/test-fixtures/remove-duplicate-datafields/f03b/expectedResult.json +20 -0
- package/test-fixtures/remove-duplicate-datafields/f03b/metadata.json +6 -0
- package/test-fixtures/remove-duplicate-datafields/f03b/record.json +35 -0
- package/test-fixtures/remove-duplicate-datafields/f03c/expectedResult.json +25 -0
- package/test-fixtures/remove-duplicate-datafields/f03c/metadata.json +6 -0
- package/test-fixtures/remove-duplicate-datafields/f03c/record.json +43 -0
- package/test-fixtures/remove-duplicate-datafields/f04/expectedResult.json +31 -0
- package/test-fixtures/remove-duplicate-datafields/f04/metadata.json +6 -0
- package/test-fixtures/remove-duplicate-datafields/f04/record.json +41 -0
- package/test-fixtures/remove-duplicate-datafields/f05/expectedResult.json +23 -0
- package/test-fixtures/remove-duplicate-datafields/f05/metadata.json +6 -0
- package/test-fixtures/remove-duplicate-datafields/f05/record.json +29 -0
- package/test-fixtures/remove-duplicate-datafields/f06/expectedResult.json +24 -0
- package/test-fixtures/remove-duplicate-datafields/f06/metadata.json +6 -0
- package/test-fixtures/remove-duplicate-datafields/f06/record.json +41 -0
- package/test-fixtures/remove-duplicate-datafields/f07/expectedResult.json +15 -0
- package/test-fixtures/remove-duplicate-datafields/f07/metadata.json +6 -0
- package/test-fixtures/remove-duplicate-datafields/f07/record.json +21 -0
- package/test-fixtures/remove-duplicate-datafields/f08/expectedResult.json +21 -0
- package/test-fixtures/remove-duplicate-datafields/f08/metadata.json +6 -0
- package/test-fixtures/remove-duplicate-datafields/f08/record.json +33 -0
- package/test-fixtures/remove-duplicate-datafields/f09/expectedResult.json +6 -0
- package/test-fixtures/remove-duplicate-datafields/f09/metadata.json +6 -0
- package/test-fixtures/remove-duplicate-datafields/f09/record.json +9 -0
- package/test-fixtures/remove-duplicate-datafields/f10/expectedResult.json +15 -0
- package/test-fixtures/remove-duplicate-datafields/f10/metadata.json +6 -0
- package/test-fixtures/remove-duplicate-datafields/f10/record.json +24 -0
- package/test-fixtures/remove-duplicate-datafields/f11/expectedResult.json +30 -0
- package/test-fixtures/remove-duplicate-datafields/f11/metadata.json +6 -0
- package/test-fixtures/remove-duplicate-datafields/f11/record.json +53 -0
- package/test-fixtures/remove-duplicate-datafields/v01/expectedResult.json +6 -0
- package/test-fixtures/remove-duplicate-datafields/v01/metadata.json +6 -0
- package/test-fixtures/remove-duplicate-datafields/v01/record.json +31 -0
- package/test-fixtures/remove-duplicate-datafields/v02/expectedResult.json +10 -0
- package/test-fixtures/remove-duplicate-datafields/v02/metadata.json +6 -0
- package/test-fixtures/remove-duplicate-datafields/v02/record.json +45 -0
- package/test-fixtures/remove-duplicate-datafields/v03/expectedResult.json +6 -0
- package/test-fixtures/remove-duplicate-datafields/v03/metadata.json +7 -0
- package/test-fixtures/remove-duplicate-datafields/v03/record.json +37 -0
- package/test-fixtures/remove-duplicate-datafields/v04/expectedResult.json +8 -0
- package/test-fixtures/remove-duplicate-datafields/v04/metadata.json +6 -0
- package/test-fixtures/remove-duplicate-datafields/v04/record.json +41 -0
- package/test-fixtures/remove-inferior-datafields/f01/expectedResult.json +21 -0
- package/test-fixtures/remove-inferior-datafields/f01/metadata.json +6 -0
- package/test-fixtures/remove-inferior-datafields/f01/record.json +31 -0
- package/test-fixtures/remove-inferior-datafields/f03/expectedResult.json +16 -0
- package/test-fixtures/remove-inferior-datafields/f03/metadata.json +6 -0
- package/test-fixtures/remove-inferior-datafields/f03/record.json +27 -0
- package/test-fixtures/remove-inferior-datafields/f04/expectedResult.json +31 -0
- package/test-fixtures/remove-inferior-datafields/f04/metadata.json +6 -0
- package/test-fixtures/remove-inferior-datafields/f04/record.json +38 -0
- package/test-fixtures/remove-inferior-datafields/f05/expectedResult.json +34 -0
- package/test-fixtures/remove-inferior-datafields/f05/metadata.json +6 -0
- package/test-fixtures/remove-inferior-datafields/f05/record.json +41 -0
- package/test-fixtures/remove-inferior-datafields/f06/expectedResult.json +16 -0
- package/test-fixtures/remove-inferior-datafields/f06/metadata.json +6 -0
- package/test-fixtures/remove-inferior-datafields/f06/record.json +20 -0
- package/test-fixtures/remove-inferior-datafields/v01/expectedResult.json +6 -0
- package/test-fixtures/remove-inferior-datafields/v01/metadata.json +6 -0
- package/test-fixtures/remove-inferior-datafields/v01/record.json +31 -0
- package/test-fixtures/remove-inferior-datafields/v02/expectedResult.json +6 -0
- package/test-fixtures/remove-inferior-datafields/v02/metadata.json +6 -0
- package/test-fixtures/remove-inferior-datafields/v02/record.json +21 -0
- package/test-fixtures/remove-orphanded-sf6s/f01/expectedResult.json +35 -0
- package/test-fixtures/remove-orphanded-sf6s/f01/metadata.json +6 -0
- package/test-fixtures/remove-orphanded-sf6s/f01/record.json +34 -0
- package/test-fixtures/remove-orphanded-sf6s/f02/expectedResult.json +40 -0
- package/test-fixtures/remove-orphanded-sf6s/f02/metadata.json +6 -0
- package/test-fixtures/remove-orphanded-sf6s/f02/record.json +43 -0
- package/test-fixtures/remove-orphanded-sf6s/v01/expectedResult.json +6 -0
- package/test-fixtures/remove-orphanded-sf6s/v01/metadata.json +6 -0
- package/test-fixtures/remove-orphanded-sf6s/v01/record.json +31 -0
- package/test-fixtures/remove-orphanded-sf6s/v02/expectedResult.json +6 -0
- package/test-fixtures/remove-orphanded-sf6s/v02/metadata.json +6 -0
- package/test-fixtures/remove-orphanded-sf6s/v02/record.json +31 -0
- package/test-fixtures/resolvable-ext-references-melinda.js +0 -27
- package/test-fixtures/sanitize-vocabulary-source-codes/f01/expectedResult.json +32 -0
- package/test-fixtures/sanitize-vocabulary-source-codes/f01/metadata.json +6 -0
- package/test-fixtures/sanitize-vocabulary-source-codes/f01/record.json +32 -0
- package/test-fixtures/sanitize-vocabulary-source-codes/f02/expectedResult.json +24 -0
- package/test-fixtures/sanitize-vocabulary-source-codes/f02/metadata.json +6 -0
- package/test-fixtures/sanitize-vocabulary-source-codes/f02/record.json +24 -0
- package/test-fixtures/sanitize-vocabulary-source-codes/v01/expectedResult.json +12 -0
- package/test-fixtures/sanitize-vocabulary-source-codes/v01/metadata.json +6 -0
- package/test-fixtures/sanitize-vocabulary-source-codes/v01/record.json +24 -0
- package/test-fixtures/sort-relator-terms/f01/expectedResult.json +23 -0
- package/test-fixtures/sort-relator-terms/f01/metadata.json +6 -0
- package/test-fixtures/sort-relator-terms/f01/record.json +22 -0
- package/test-fixtures/sort-relator-terms/f02/expectedResult.json +26 -0
- package/test-fixtures/sort-relator-terms/f02/metadata.json +6 -0
- package/test-fixtures/sort-relator-terms/f02/record.json +22 -0
- package/test-fixtures/sort-relator-terms/v01/expectedResult.json +5 -0
- package/test-fixtures/sort-relator-terms/v01/metadata.json +6 -0
- package/test-fixtures/sort-relator-terms/v01/record.json +22 -0
- package/test-fixtures/sort-relator-terms/v02/expectedResult.json +6 -0
- package/test-fixtures/sort-relator-terms/v02/metadata.json +6 -0
- package/test-fixtures/sort-relator-terms/v02/record.json +14 -0
- package/test-fixtures/sort-subfields/f01/expectedResult.json +24 -0
- package/test-fixtures/sort-subfields/f01/metadata.json +6 -0
- package/test-fixtures/sort-subfields/f01/record.json +20 -0
- package/test-fixtures/sort-subfields/v01/expectedResult.json +5 -0
- package/test-fixtures/sort-subfields/v01/metadata.json +6 -0
- package/test-fixtures/sort-subfields/v01/record.json +24 -0
- package/test-fixtures/sort-subfields/v02/expectedResult.json +6 -0
- package/test-fixtures/sort-subfields/v02/metadata.json +6 -0
- package/test-fixtures/sort-subfields/v02/record.json +8 -0
- package/test-fixtures/strip-punctuation/01/expectedResult.json +12 -0
- package/test-fixtures/strip-punctuation/01/metadata.json +6 -0
- package/test-fixtures/strip-punctuation/01/record.json +37 -0
- package/test-fixtures/strip-punctuation/02/expectedResult.json +4 -0
- package/test-fixtures/strip-punctuation/02/metadata.json +6 -0
- package/test-fixtures/strip-punctuation/02/record.json +14 -0
- package/test-fixtures/strip-punctuation/04/expectedResult.json +6 -0
- package/test-fixtures/strip-punctuation/04/metadata.json +6 -0
- package/test-fixtures/strip-punctuation/04/record.json +22 -0
- package/test-fixtures/strip-punctuation/05/expectedResult.json +6 -0
- package/test-fixtures/strip-punctuation/05/metadata.json +6 -0
- package/test-fixtures/strip-punctuation/05/record.json +12 -0
- package/test-fixtures/strip-punctuation/98/expectedResult.json +44 -0
- package/test-fixtures/strip-punctuation/98/metadata.json +6 -0
- package/test-fixtures/strip-punctuation/98/record.json +45 -0
- package/test-fixtures/strip-punctuation/99/expectedResult.json +16 -0
- package/test-fixtures/strip-punctuation/99/metadata.json +6 -0
- package/test-fixtures/strip-punctuation/99/record.json +16 -0
- package/test-fixtures/subfield0/f01/expectedResult.json +25 -0
- package/test-fixtures/subfield0/f01/metadata.json +6 -0
- package/test-fixtures/subfield0/f01/record.json +23 -0
- package/test-fixtures/subfield0/f02/expectedResult.json +35 -0
- package/test-fixtures/subfield0/f02/metadata.json +6 -0
- package/test-fixtures/subfield0/f02/record.json +41 -0
- package/test-fixtures/subfield0/f03/expectedResult.json +21 -0
- package/test-fixtures/subfield0/f03/metadata.json +7 -0
- package/test-fixtures/subfield0/f03/record.json +24 -0
- package/test-fixtures/subfield0/v01/expectedResult.json +4 -0
- package/test-fixtures/subfield0/v01/metadata.json +6 -0
- package/test-fixtures/subfield0/v01/record.json +23 -0
- package/test-fixtures/subfield0/v02/expectedResult.json +9 -0
- package/test-fixtures/subfield0/v02/metadata.json +6 -0
- package/test-fixtures/subfield0/v02/record.json +38 -0
- package/test-fixtures/typeOfDate-008/01/expectedResult.json +3 -0
- package/test-fixtures/typeOfDate-008/01/metadata.json +4 -0
- package/test-fixtures/typeOfDate-008/01/record.json +14 -0
- package/test-fixtures/typeOfDate-008/02/expectedResult.json +4 -0
- package/test-fixtures/typeOfDate-008/02/metadata.json +4 -0
- package/test-fixtures/typeOfDate-008/02/record.json +14 -0
- package/test-fixtures/typeOfDate-008/03/expectedResult.json +14 -0
- package/test-fixtures/typeOfDate-008/03/metadata.json +5 -0
- package/test-fixtures/typeOfDate-008/03/record.json +14 -0
- package/test-fixtures/typeOfDate-008/04/expectedResult.json +14 -0
- package/test-fixtures/typeOfDate-008/04/metadata.json +5 -0
- package/test-fixtures/typeOfDate-008/04/record.json +14 -0
- package/test-fixtures/typeOfDate-008/05/expectedResult.json +14 -0
- package/test-fixtures/typeOfDate-008/05/metadata.json +5 -0
- package/test-fixtures/typeOfDate-008/05/record.json +14 -0
- package/test-fixtures/update-field-540/f01/expectedResult.json +23 -0
- package/test-fixtures/update-field-540/f01/metadata.json +6 -0
- package/test-fixtures/update-field-540/f01/record.json +23 -0
- package/test-fixtures/update-field-540/v01/expectedResult.json +7 -0
- package/test-fixtures/update-field-540/v01/metadata.json +6 -0
- package/test-fixtures/update-field-540/v01/record.json +23 -0
- package/.travis.yml +0 -10
|
@@ -0,0 +1,281 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = _default;
|
|
7
|
+
var _marcRecord = require("@natlibfi/marc-record");
|
|
8
|
+
var _debug = _interopRequireDefault(require("debug"));
|
|
9
|
+
var _rules = require("./rules");
|
|
10
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
|
+
const debug = (0, _debug.default)('@natlibfi/marc-record-validator-melinda/punctuation');
|
|
12
|
+
function cloneDeep(field) {
|
|
13
|
+
const r = new _marcRecord.MarcRecord();
|
|
14
|
+
r.appendField(field);
|
|
15
|
+
return r.get(field.tag)?.[0];
|
|
16
|
+
}
|
|
17
|
+
function _default() {
|
|
18
|
+
function readPunctuationRulesFromJSON(recordType) {
|
|
19
|
+
const json = getRules(recordType);
|
|
20
|
+
const rules = json.filter(row => row.selector !== '').map(row => {
|
|
21
|
+
const {
|
|
22
|
+
selector,
|
|
23
|
+
namePortion,
|
|
24
|
+
description,
|
|
25
|
+
portion,
|
|
26
|
+
preceedingPunctuation,
|
|
27
|
+
exceptions
|
|
28
|
+
} = row;
|
|
29
|
+
return {
|
|
30
|
+
selector: new RegExp(selector.replace(/X/ug, '.'), 'u'),
|
|
31
|
+
namePortion: namePortion.replace(/\$/ug, '').trim(),
|
|
32
|
+
description,
|
|
33
|
+
portion,
|
|
34
|
+
preceedingPunctuation,
|
|
35
|
+
exceptions
|
|
36
|
+
};
|
|
37
|
+
});
|
|
38
|
+
return rules;
|
|
39
|
+
}
|
|
40
|
+
function getRules(recordType) {
|
|
41
|
+
if (recordType === 'z') {
|
|
42
|
+
return _rules.autRules;
|
|
43
|
+
}
|
|
44
|
+
return _rules.bibRules;
|
|
45
|
+
}
|
|
46
|
+
function fieldToString(field) {
|
|
47
|
+
if (field && field.subfields) {
|
|
48
|
+
const ind1 = field.ind1 || ' ';
|
|
49
|
+
const ind2 = field.ind2 || ' ';
|
|
50
|
+
const subfields = field.subfields.map(subfield => `‡${subfield.code}${subfield.value}`).join('');
|
|
51
|
+
return `${field.tag} ${ind1}${ind2} ${subfields}`;
|
|
52
|
+
}
|
|
53
|
+
return `${field.tag} ${field.value}`;
|
|
54
|
+
}
|
|
55
|
+
function validateField(recordType = 'a') {
|
|
56
|
+
return function (element) {
|
|
57
|
+
const testField = cloneDeep(element);
|
|
58
|
+
debug(`Original field: ${JSON.stringify(element)}`);
|
|
59
|
+
const punctuated = punctuateField(testField, recordType);
|
|
60
|
+
debug(`Punctuation result: ${JSON.stringify(punctuated)}`);
|
|
61
|
+
if (!punctuated) {
|
|
62
|
+
debug('No punctuation result -> true');
|
|
63
|
+
return true;
|
|
64
|
+
}
|
|
65
|
+
if (_marcRecord.MarcRecord.isEqual(punctuated, element)) {
|
|
66
|
+
debug(`Original field (element): ${JSON.stringify(element)}`);
|
|
67
|
+
debug('Punctuation result equals original field');
|
|
68
|
+
return true;
|
|
69
|
+
}
|
|
70
|
+
return false;
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
function punctuateField(field, recordType) {
|
|
74
|
+
const rules = readPunctuationRulesFromJSON(recordType);
|
|
75
|
+
debug(`Handling field ${field.tag}`);
|
|
76
|
+
debug(`Field contents: ${fieldToString(field)}`);
|
|
77
|
+
const rulesForField = getRulesForField(field.tag, rules);
|
|
78
|
+
if (rulesForField.length === 0) {
|
|
79
|
+
debug(`No matching rules for field ${field.tag}`);
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
let currentPortion; // eslint-disable-line functional/no-let
|
|
83
|
+
let preceedingField; // eslint-disable-line functional/no-let
|
|
84
|
+
let inNamePortion = true; // eslint-disable-line functional/no-let
|
|
85
|
+
|
|
86
|
+
debug(`Field subfields: ${field.subfields.map(sub => sub.code)}`);
|
|
87
|
+
debug(`Field portions: ${field.subfields.map(sub => getPortion(sub, rulesForField))}`);
|
|
88
|
+
field.subfields.forEach(subfield => {
|
|
89
|
+
debug(`Handling subfield ${subfield.code}`);
|
|
90
|
+
let portion = getPortion(subfield, rulesForField); // eslint-disable-line functional/no-let
|
|
91
|
+
|
|
92
|
+
if (portion === false) {
|
|
93
|
+
return;
|
|
94
|
+
}
|
|
95
|
+
if (portion === 'CF' || portion === 'NC') {
|
|
96
|
+
return;
|
|
97
|
+
}
|
|
98
|
+
if (inNamePortion && portion.includes('T', 'S')) {
|
|
99
|
+
// eslint-disable-line functional/no-conditional-statements
|
|
100
|
+
debug(`Portion changed to ${portion}. Not in name portion anymore`);
|
|
101
|
+
inNamePortion = false;
|
|
102
|
+
}
|
|
103
|
+
if (inNamePortion && portion === 'NT') {
|
|
104
|
+
// eslint-disable-line functional/no-conditional-statements
|
|
105
|
+
portion = 'N';
|
|
106
|
+
}
|
|
107
|
+
if (!inNamePortion && portion === 'NT') {
|
|
108
|
+
// eslint-disable-line functional/no-conditional-statements
|
|
109
|
+
portion = 'T';
|
|
110
|
+
}
|
|
111
|
+
debug(`Current portion is ${portion}.`);
|
|
112
|
+
if (currentPortion) {
|
|
113
|
+
if (currentPortion === portion) {
|
|
114
|
+
// eslint-disable-line functional/no-conditional-statements
|
|
115
|
+
debug(`Current stayed as ${portion}. Adding punctuation for subfield.`);
|
|
116
|
+
addSubfieldPunctuation(preceedingField, subfield, rulesForField);
|
|
117
|
+
} else {
|
|
118
|
+
debug(`Current portion changed to ${portion}.`);
|
|
119
|
+
if (portion !== 'S') {
|
|
120
|
+
// eslint-disable-line functional/no-conditional-statements
|
|
121
|
+
debug('Adding punctuation for portion.');
|
|
122
|
+
addNamePortionPunctuation(preceedingField);
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
currentPortion = portion;
|
|
127
|
+
preceedingField = subfield;
|
|
128
|
+
});
|
|
129
|
+
if (recordType !== 'z') {
|
|
130
|
+
// eslint-disable-line functional/no-conditional-statements
|
|
131
|
+
addNamePortionPunctuation(preceedingField);
|
|
132
|
+
}
|
|
133
|
+
debug(`After punctuation: ${fieldToString(field)}`);
|
|
134
|
+
return field;
|
|
135
|
+
}
|
|
136
|
+
function getRulesForField(tag, rules) {
|
|
137
|
+
return rules.filter(rule => rule.selector.test(tag));
|
|
138
|
+
}
|
|
139
|
+
function getPortion(subfield, rules) {
|
|
140
|
+
debug(`Looking for namePortion for ${subfield.code}`);
|
|
141
|
+
const [portion] = rules.filter(rule => rule.namePortion === subfield.code).map(rule => rule.portion);
|
|
142
|
+
if (portion === undefined) {
|
|
143
|
+
return false;
|
|
144
|
+
}
|
|
145
|
+
return portion.toUpperCase();
|
|
146
|
+
}
|
|
147
|
+
function addNamePortionPunctuation(preceedingSubfield) {
|
|
148
|
+
const subfieldContainsPunctuation = /[?")\].\-!,]$/u.test(preceedingSubfield.value);
|
|
149
|
+
if (!subfieldContainsPunctuation) {
|
|
150
|
+
// eslint-disable-line functional/no-conditional-statements
|
|
151
|
+
const nextValue = `${preceedingSubfield.value}.`;
|
|
152
|
+
debug(`Updated subfield ${preceedingSubfield.code} from '${preceedingSubfield.value}' to '${nextValue}'`);
|
|
153
|
+
preceedingSubfield.value = nextValue; // eslint-disable-line functional/immutable-data
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
function addSubfieldPunctuation(preceedingSubfield, currentSubfield, rules) {
|
|
158
|
+
const punctType = getPrecedingPunctuation(currentSubfield, rules);
|
|
159
|
+
const exceptionsFunctions = getExceptions(currentSubfield, rules);
|
|
160
|
+
const isExceptionCase = exceptionsFunctions.some(fn => fn(preceedingSubfield));
|
|
161
|
+
if (isExceptionCase) {
|
|
162
|
+
return;
|
|
163
|
+
}
|
|
164
|
+
const endsInPunctuation = /[?")\]\-!,]$/u.test(preceedingSubfield.value);
|
|
165
|
+
debug(`addSubfieldPunctuation -- punctType: ${punctType} endsInPunctuation: ${endsInPunctuation}`);
|
|
166
|
+
if (!endsInPunctuation) {
|
|
167
|
+
if (punctType === 'PERIOD' && !/\.$/u.test(preceedingSubfield.value)) {
|
|
168
|
+
// eslint-disable-line functional/no-conditional-statements
|
|
169
|
+
const nextValue = `${preceedingSubfield.value}.`;
|
|
170
|
+
debug(`Updated subfield ${preceedingSubfield.code} from '${preceedingSubfield.value}' to '${nextValue}'`);
|
|
171
|
+
preceedingSubfield.value = nextValue; // eslint-disable-line functional/immutable-data
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
if (punctType === 'COMMA') {
|
|
176
|
+
if (!/,$/u.test(preceedingSubfield.value)) {
|
|
177
|
+
if (!/^[[(]/u.test(currentSubfield.value)) {
|
|
178
|
+
// eslint-disable-line functional/no-conditional-statements
|
|
179
|
+
const nextValue = `${preceedingSubfield.value},`;
|
|
180
|
+
debug(`Updated subfield ${preceedingSubfield.code} from '${preceedingSubfield.value}' to '${nextValue}'`);
|
|
181
|
+
preceedingSubfield.value = nextValue; // eslint-disable-line functional/immutable-data
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
if (punctType === 'COND_COMMA') {
|
|
187
|
+
if (!/[-,]$/u.test(preceedingSubfield.value)) {
|
|
188
|
+
// eslint-disable-line functional/no-conditional-statements
|
|
189
|
+
const nextValue = `${preceedingSubfield.value},`;
|
|
190
|
+
debug(`Updated subfield ${preceedingSubfield.code} from '${preceedingSubfield.value}' to '${nextValue}'`);
|
|
191
|
+
preceedingSubfield.value = nextValue; // eslint-disable-line functional/immutable-data
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
if (punctType === 'SPACECOLON') {
|
|
196
|
+
if (!/:$/u.test(preceedingSubfield.value)) {
|
|
197
|
+
// eslint-disable-line functional/no-conditional-statements
|
|
198
|
+
const nextValue = `${preceedingSubfield.value} :`;
|
|
199
|
+
debug(`Updated subfield ${preceedingSubfield.code} from '${preceedingSubfield.value}' to '${nextValue}'`);
|
|
200
|
+
preceedingSubfield.value = nextValue; // eslint-disable-line functional/immutable-data
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
if (/[^ ]:$/u.test(preceedingSubfield.value)) {
|
|
204
|
+
// eslint-disable-line functional/no-conditional-statements
|
|
205
|
+
const nextValue = `${preceedingSubfield.value.slice(0, -1)} :`;
|
|
206
|
+
debug(`Updated subfield ${preceedingSubfield.code} from '${preceedingSubfield.value}' to '${nextValue}'`);
|
|
207
|
+
preceedingSubfield.value = nextValue; // eslint-disable-line functional/immutable-data
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
debug('addSubfieldPunctuation -- end');
|
|
212
|
+
}
|
|
213
|
+
function getPrecedingPunctuation(subfield, rules) {
|
|
214
|
+
const [punct] = rules.filter(rule => rule.namePortion === subfield.code).map(rule => rule.preceedingPunctuation);
|
|
215
|
+
if (punct === undefined) {
|
|
216
|
+
throw new Error(`Unknown subfield code ${subfield.code}`);
|
|
217
|
+
}
|
|
218
|
+
return punct.toUpperCase();
|
|
219
|
+
}
|
|
220
|
+
function getExceptions(subfield, rules) {
|
|
221
|
+
const [exception] = rules.filter(rule => rule.namePortion === subfield.code).map(rule => parseExceptions(rule.exceptions));
|
|
222
|
+
if (exception === undefined) {
|
|
223
|
+
throw new Error(`Unknown subfield code ${subfield.code}`);
|
|
224
|
+
}
|
|
225
|
+
return exception;
|
|
226
|
+
}
|
|
227
|
+
function parseExceptions(expectionsString) {
|
|
228
|
+
const exceptionRules = expectionsString.split('\n');
|
|
229
|
+
const exceptionFuncs = [];
|
|
230
|
+
exceptionRules.forEach(exceptionRule => {
|
|
231
|
+
const match = /- (.*) if preceded by (.*)/u.exec(exceptionRule); // eslint-disable-line prefer-named-capture-group
|
|
232
|
+
if (match) {
|
|
233
|
+
// eslint-disable-line functional/no-conditional-statements
|
|
234
|
+
const [, type, preceededCode] = match;
|
|
235
|
+
const normalizedType = type.trim().toUpperCase().trim();
|
|
236
|
+
const normalizedCode = preceededCode.replace(/\$/ug, '').trim();
|
|
237
|
+
exceptionFuncs.push(ifPrecededByException(normalizedCode, normalizedType)); // eslint-disable-line functional/immutable-data
|
|
238
|
+
}
|
|
239
|
+
});
|
|
240
|
+
|
|
241
|
+
return exceptionFuncs;
|
|
242
|
+
}
|
|
243
|
+
function ifPrecededByException(code, type) {
|
|
244
|
+
return preceedingSubfield => {
|
|
245
|
+
if (code === preceedingSubfield.code) {
|
|
246
|
+
debug(`Adding ${type} to ${preceedingSubfield.code}`);
|
|
247
|
+
if (type === 'SEMICOLON' && !/;$/u.test(preceedingSubfield.value)) {
|
|
248
|
+
// eslint-disable-line functional/no-conditional-statements
|
|
249
|
+
const nextValue = `${preceedingSubfield.value} ;`;
|
|
250
|
+
debug(`Updated subfield ${preceedingSubfield.code} from '${preceedingSubfield.value}' to '${nextValue}'`);
|
|
251
|
+
preceedingSubfield.value = nextValue; // eslint-disable-line functional/immutable-data
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
if (type === 'COLON' && !/:$/u.test(preceedingSubfield.value)) {
|
|
255
|
+
// eslint-disable-line functional/no-conditional-statements
|
|
256
|
+
const nextValue = `${preceedingSubfield.value} :`;
|
|
257
|
+
debug(`Updated subfield ${preceedingSubfield.code} from '${preceedingSubfield.value}' to '${nextValue}'`);
|
|
258
|
+
preceedingSubfield.value = nextValue; // eslint-disable-line functional/immutable-data
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
return true;
|
|
262
|
+
}
|
|
263
|
+
return false;
|
|
264
|
+
};
|
|
265
|
+
}
|
|
266
|
+
function validate(record) {
|
|
267
|
+
return {
|
|
268
|
+
valid: record.fields.every(validateField(record.leader[6]))
|
|
269
|
+
};
|
|
270
|
+
}
|
|
271
|
+
function fix(record) {
|
|
272
|
+
record.fields.map(field => punctuateField(field, record.leader[6]));
|
|
273
|
+
return true;
|
|
274
|
+
}
|
|
275
|
+
return {
|
|
276
|
+
description: 'Fixes punctuation of fields',
|
|
277
|
+
validate,
|
|
278
|
+
fix
|
|
279
|
+
};
|
|
280
|
+
}
|
|
281
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":["_marcRecord","require","_debug","_interopRequireDefault","_rules","obj","__esModule","default","debug","createDebug","cloneDeep","field","r","MarcRecord","appendField","get","tag","_default","readPunctuationRulesFromJSON","recordType","json","getRules","rules","filter","row","selector","map","namePortion","description","portion","preceedingPunctuation","exceptions","RegExp","replace","trim","autRules","bibRules","fieldToString","subfields","ind1","ind2","subfield","code","value","join","validateField","element","testField","JSON","stringify","punctuated","punctuateField","isEqual","rulesForField","getRulesForField","length","currentPortion","preceedingField","inNamePortion","sub","getPortion","forEach","includes","addSubfieldPunctuation","addNamePortionPunctuation","rule","test","undefined","toUpperCase","preceedingSubfield","subfieldContainsPunctuation","nextValue","currentSubfield","punctType","getPrecedingPunctuation","exceptionsFunctions","getExceptions","isExceptionCase","some","fn","endsInPunctuation","slice","punct","Error","exception","parseExceptions","expectionsString","exceptionRules","split","exceptionFuncs","exceptionRule","match","exec","type","preceededCode","normalizedType","normalizedCode","push","ifPrecededByException","validate","record","valid","fields","every","leader","fix"],"sources":["../../src/punctuation/index.js"],"sourcesContent":["import {MarcRecord} from '@natlibfi/marc-record';\nimport createDebug from 'debug';\nimport {autRules, bibRules} from './rules';\n\nconst debug = createDebug('@natlibfi/marc-record-validator-melinda/punctuation');\n\nfunction cloneDeep(field) {\n const r = new MarcRecord();\n r.appendField(field);\n return r.get(field.tag)?.[0];\n}\n\nexport default function () {\n function readPunctuationRulesFromJSON(recordType) {\n const json = getRules(recordType);\n const rules = json.filter(row => row.selector !== '').map(row => {\n const {selector, namePortion, description, portion, preceedingPunctuation, exceptions} = row;\n return {\n selector: new RegExp(selector.replace(/X/ug, '.'), 'u'),\n namePortion: namePortion.replace(/\\$/ug, '').trim(),\n description, portion, preceedingPunctuation, exceptions\n };\n });\n\n return rules;\n }\n\n function getRules(recordType) {\n if (recordType === 'z') {\n return autRules;\n }\n\n return bibRules;\n }\n\n function fieldToString(field) {\n if (field && field.subfields) {\n const ind1 = field.ind1 || ' ';\n const ind2 = field.ind2 || ' ';\n const subfields = field.subfields.map(subfield => `‡${subfield.code}${subfield.value}`).join('');\n return `${field.tag} ${ind1}${ind2} ${subfields}`;\n }\n\n return `${field.tag} ${field.value}`;\n }\n\n function validateField(recordType = 'a') {\n return function (element) {\n const testField = cloneDeep(element);\n debug(`Original field: ${JSON.stringify(element)}`);\n const punctuated = punctuateField(testField, recordType);\n debug(`Punctuation result: ${JSON.stringify(punctuated)}`);\n if (!punctuated) {\n debug('No punctuation result -> true');\n return true;\n }\n\n if (MarcRecord.isEqual(punctuated, element)) {\n debug(`Original field (element): ${JSON.stringify(element)}`);\n debug('Punctuation result equals original field');\n return true;\n }\n\n return false;\n };\n }\n\n function punctuateField(field, recordType) {\n const rules = readPunctuationRulesFromJSON(recordType);\n debug(`Handling field ${field.tag}`);\n debug(`Field contents: ${fieldToString(field)}`);\n const rulesForField = getRulesForField(field.tag, rules);\n if (rulesForField.length === 0) {\n debug(`No matching rules for field ${field.tag}`);\n return;\n }\n\n let currentPortion; // eslint-disable-line functional/no-let\n let preceedingField; // eslint-disable-line functional/no-let\n let inNamePortion = true; // eslint-disable-line functional/no-let\n\n debug(`Field subfields: ${field.subfields.map(sub => sub.code)}`);\n debug(`Field portions: ${field.subfields.map(sub => getPortion(sub, rulesForField))}`);\n\n field.subfields.forEach(subfield => {\n debug(`Handling subfield ${subfield.code}`);\n let portion = getPortion(subfield, rulesForField); // eslint-disable-line functional/no-let\n\n if (portion === false) {\n return;\n }\n\n if (portion === 'CF' || portion === 'NC') {\n return;\n }\n\n if (inNamePortion && portion.includes('T', 'S')) { // eslint-disable-line functional/no-conditional-statements\n debug(`Portion changed to ${portion}. Not in name portion anymore`);\n inNamePortion = false;\n }\n\n if (inNamePortion && portion === 'NT') { // eslint-disable-line functional/no-conditional-statements\n portion = 'N';\n }\n\n if (!inNamePortion && portion === 'NT') { // eslint-disable-line functional/no-conditional-statements\n portion = 'T';\n }\n\n debug(`Current portion is ${portion}.`);\n\n if (currentPortion) {\n if (currentPortion === portion) { // eslint-disable-line functional/no-conditional-statements\n debug(`Current stayed as ${portion}. Adding punctuation for subfield.`);\n addSubfieldPunctuation(preceedingField, subfield, rulesForField);\n } else {\n debug(`Current portion changed to ${portion}.`);\n if (portion !== 'S') { // eslint-disable-line functional/no-conditional-statements\n debug('Adding punctuation for portion.');\n addNamePortionPunctuation(preceedingField);\n }\n }\n }\n\n currentPortion = portion;\n preceedingField = subfield;\n });\n\n if (recordType !== 'z') { // eslint-disable-line functional/no-conditional-statements\n addNamePortionPunctuation(preceedingField);\n }\n\n debug(`After punctuation: ${fieldToString(field)}`);\n\n return field;\n }\n\n function getRulesForField(tag, rules) {\n return rules.filter(rule => rule.selector.test(tag));\n }\n\n function getPortion(subfield, rules) {\n debug(`Looking for namePortion for ${subfield.code}`);\n const [portion] = rules.filter(rule => rule.namePortion === subfield.code).map(rule => rule.portion);\n\n if (portion === undefined) {\n return false;\n }\n\n return portion.toUpperCase();\n }\n\n function addNamePortionPunctuation(preceedingSubfield) {\n const subfieldContainsPunctuation = (/[?\")\\].\\-!,]$/u).test(preceedingSubfield.value);\n if (!subfieldContainsPunctuation) { // eslint-disable-line functional/no-conditional-statements\n const nextValue = `${preceedingSubfield.value}.`;\n debug(`Updated subfield ${preceedingSubfield.code} from '${preceedingSubfield.value}' to '${nextValue}'`);\n preceedingSubfield.value = nextValue; // eslint-disable-line functional/immutable-data\n }\n }\n\n function addSubfieldPunctuation(preceedingSubfield, currentSubfield, rules) {\n const punctType = getPrecedingPunctuation(currentSubfield, rules);\n const exceptionsFunctions = getExceptions(currentSubfield, rules);\n\n const isExceptionCase = exceptionsFunctions.some(fn => fn(preceedingSubfield));\n\n if (isExceptionCase) {\n return;\n }\n\n const endsInPunctuation = (/[?\")\\]\\-!,]$/u).test(preceedingSubfield.value);\n debug(`addSubfieldPunctuation -- punctType: ${punctType} endsInPunctuation: ${endsInPunctuation}`);\n\n if (!endsInPunctuation) {\n if (punctType === 'PERIOD' && !(/\\.$/u).test(preceedingSubfield.value)) { // eslint-disable-line functional/no-conditional-statements\n const nextValue = `${preceedingSubfield.value}.`;\n debug(`Updated subfield ${preceedingSubfield.code} from '${preceedingSubfield.value}' to '${nextValue}'`);\n preceedingSubfield.value = nextValue; // eslint-disable-line functional/immutable-data\n }\n }\n\n if (punctType === 'COMMA') {\n if (!(/,$/u).test(preceedingSubfield.value)) {\n if (!(/^[[(]/u).test(currentSubfield.value)) { // eslint-disable-line functional/no-conditional-statements\n const nextValue = `${preceedingSubfield.value},`;\n debug(`Updated subfield ${preceedingSubfield.code} from '${preceedingSubfield.value}' to '${nextValue}'`);\n preceedingSubfield.value = nextValue; // eslint-disable-line functional/immutable-data\n }\n }\n }\n\n if (punctType === 'COND_COMMA') {\n if (!(/[-,]$/u).test(preceedingSubfield.value)) { // eslint-disable-line functional/no-conditional-statements\n const nextValue = `${preceedingSubfield.value},`;\n debug(`Updated subfield ${preceedingSubfield.code} from '${preceedingSubfield.value}' to '${nextValue}'`);\n preceedingSubfield.value = nextValue; // eslint-disable-line functional/immutable-data\n }\n }\n\n if (punctType === 'SPACECOLON') {\n if (!(/:$/u).test(preceedingSubfield.value)) { // eslint-disable-line functional/no-conditional-statements\n const nextValue = `${preceedingSubfield.value} :`;\n debug(`Updated subfield ${preceedingSubfield.code} from '${preceedingSubfield.value}' to '${nextValue}'`);\n preceedingSubfield.value = nextValue; // eslint-disable-line functional/immutable-data\n }\n if ((/[^ ]:$/u).test(preceedingSubfield.value)) { // eslint-disable-line functional/no-conditional-statements\n const nextValue = `${preceedingSubfield.value.slice(0, -1)} :`;\n debug(`Updated subfield ${preceedingSubfield.code} from '${preceedingSubfield.value}' to '${nextValue}'`);\n preceedingSubfield.value = nextValue; // eslint-disable-line functional/immutable-data\n }\n\n }\n\n debug('addSubfieldPunctuation -- end');\n }\n\n function getPrecedingPunctuation(subfield, rules) {\n const [punct] = rules.filter(rule => rule.namePortion === subfield.code).map(rule => rule.preceedingPunctuation);\n\n if (punct === undefined) {\n throw new Error(`Unknown subfield code ${subfield.code}`);\n }\n\n return punct.toUpperCase();\n }\n\n function getExceptions(subfield, rules) {\n const [exception] = rules.filter(rule => rule.namePortion === subfield.code).map(rule => parseExceptions(rule.exceptions));\n\n if (exception === undefined) {\n throw new Error(`Unknown subfield code ${subfield.code}`);\n }\n\n return exception;\n }\n\n function parseExceptions(expectionsString) {\n const exceptionRules = expectionsString.split('\\n');\n const exceptionFuncs = [];\n\n exceptionRules.forEach(exceptionRule => {\n const match = (/- (.*) if preceded by (.*)/u).exec(exceptionRule); // eslint-disable-line prefer-named-capture-group\n if (match) { // eslint-disable-line functional/no-conditional-statements\n const [, type, preceededCode] = match;\n const normalizedType = type.trim().toUpperCase().trim();\n const normalizedCode = preceededCode.replace(/\\$/ug, '').trim();\n exceptionFuncs.push(ifPrecededByException(normalizedCode, normalizedType)); // eslint-disable-line functional/immutable-data\n }\n });\n\n return exceptionFuncs;\n }\n\n function ifPrecededByException(code, type) {\n return preceedingSubfield => {\n if (code === preceedingSubfield.code) {\n debug(`Adding ${type} to ${preceedingSubfield.code}`);\n if (type === 'SEMICOLON' && !(/;$/u).test(preceedingSubfield.value)) { // eslint-disable-line functional/no-conditional-statements\n const nextValue = `${preceedingSubfield.value} ;`;\n debug(`Updated subfield ${preceedingSubfield.code} from '${preceedingSubfield.value}' to '${nextValue}'`);\n preceedingSubfield.value = nextValue; // eslint-disable-line functional/immutable-data\n }\n\n if (type === 'COLON' && !(/:$/u).test(preceedingSubfield.value)) { // eslint-disable-line functional/no-conditional-statements\n const nextValue = `${preceedingSubfield.value} :`;\n debug(`Updated subfield ${preceedingSubfield.code} from '${preceedingSubfield.value}' to '${nextValue}'`);\n preceedingSubfield.value = nextValue; // eslint-disable-line functional/immutable-data\n }\n\n return true;\n }\n\n return false;\n };\n }\n\n function validate(record) {\n return {valid: record.fields.every(validateField(record.leader[6]))};\n }\n\n function fix(record) {\n record.fields.map(field => punctuateField(field, record.leader[6]));\n return true;\n }\n\n return {\n description: 'Fixes punctuation of fields',\n validate,\n fix\n };\n}\n"],"mappings":";;;;;;AAAA,IAAAA,WAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AAA2C,SAAAE,uBAAAE,GAAA,WAAAA,GA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|
@@ -0,0 +1,332 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
const autRules = [{
|
|
8
|
+
selector: '[1457]00',
|
|
9
|
+
namePortion: '$a',
|
|
10
|
+
description: 'Personal name (NR)',
|
|
11
|
+
portion: 'N',
|
|
12
|
+
preceedingPunctuation: 'none',
|
|
13
|
+
exceptions: ''
|
|
14
|
+
}, {
|
|
15
|
+
selector: '[1457]10',
|
|
16
|
+
namePortion: '$a',
|
|
17
|
+
description: 'Corporate name or jurisdiction name as entry element (NR)',
|
|
18
|
+
portion: 'N',
|
|
19
|
+
preceedingPunctuation: 'none',
|
|
20
|
+
exceptions: ''
|
|
21
|
+
}, {
|
|
22
|
+
selector: '[1457]11',
|
|
23
|
+
namePortion: '$a',
|
|
24
|
+
description: 'Meeting name or jurisdiction name as entry element (NR)',
|
|
25
|
+
portion: 'N',
|
|
26
|
+
preceedingPunctuation: 'none',
|
|
27
|
+
exceptions: ''
|
|
28
|
+
}, {
|
|
29
|
+
selector: '[1457]00',
|
|
30
|
+
namePortion: '$b',
|
|
31
|
+
description: 'Numeration (NR)',
|
|
32
|
+
portion: 'N',
|
|
33
|
+
preceedingPunctuation: 'none',
|
|
34
|
+
exceptions: ''
|
|
35
|
+
}, {
|
|
36
|
+
selector: '[1457]10',
|
|
37
|
+
namePortion: '$b',
|
|
38
|
+
description: 'Subordinate unit (R)',
|
|
39
|
+
portion: 'N',
|
|
40
|
+
preceedingPunctuation: 'period',
|
|
41
|
+
exceptions: ''
|
|
42
|
+
}, {
|
|
43
|
+
selector: '[1457]00',
|
|
44
|
+
namePortion: '$c',
|
|
45
|
+
description: 'Titles and words associated with a name (R)',
|
|
46
|
+
portion: 'N',
|
|
47
|
+
preceedingPunctuation: 'comma',
|
|
48
|
+
exceptions: ''
|
|
49
|
+
}, {
|
|
50
|
+
selector: '[1457](10|11)',
|
|
51
|
+
namePortion: '$c',
|
|
52
|
+
description: 'Location of meeting (R)',
|
|
53
|
+
portion: 'N',
|
|
54
|
+
preceedingPunctuation: 'comma',
|
|
55
|
+
exceptions: '- colon if preceded by $d\n- semicolon if preceded by $c'
|
|
56
|
+
}, {
|
|
57
|
+
selector: '[1457]00',
|
|
58
|
+
namePortion: '$d',
|
|
59
|
+
description: 'Dates associated with a name (NR)',
|
|
60
|
+
portion: 'N',
|
|
61
|
+
preceedingPunctuation: 'comma',
|
|
62
|
+
exceptions: '- colon if preceded by $n'
|
|
63
|
+
}, {
|
|
64
|
+
selector: '[1457]11',
|
|
65
|
+
namePortion: '$d',
|
|
66
|
+
description: 'Date of meeting (NR)',
|
|
67
|
+
portion: 'N',
|
|
68
|
+
preceedingPunctuation: '',
|
|
69
|
+
exceptions: ''
|
|
70
|
+
}, {
|
|
71
|
+
selector: '[1457](00|10)',
|
|
72
|
+
namePortion: '$e',
|
|
73
|
+
description: 'Relator term (R)',
|
|
74
|
+
portion: 'N',
|
|
75
|
+
preceedingPunctuation: 'cond_comma',
|
|
76
|
+
exceptions: ''
|
|
77
|
+
}, {
|
|
78
|
+
selector: '[1457]11',
|
|
79
|
+
namePortion: '$e',
|
|
80
|
+
description: 'Subordinate unit (R)',
|
|
81
|
+
portion: 'N',
|
|
82
|
+
preceedingPunctuation: 'period',
|
|
83
|
+
exceptions: ''
|
|
84
|
+
}, {
|
|
85
|
+
selector: '[1457]11',
|
|
86
|
+
namePortion: '$j',
|
|
87
|
+
description: 'Relator term (R)',
|
|
88
|
+
portion: 'N',
|
|
89
|
+
preceedingPunctuation: 'comma',
|
|
90
|
+
exceptions: ''
|
|
91
|
+
}, {
|
|
92
|
+
selector: '[1457]00',
|
|
93
|
+
namePortion: '$j',
|
|
94
|
+
description: 'Attribution qualifier (R)',
|
|
95
|
+
portion: 'N',
|
|
96
|
+
preceedingPunctuation: 'comma',
|
|
97
|
+
exceptions: ''
|
|
98
|
+
}, {
|
|
99
|
+
selector: '[1457]00',
|
|
100
|
+
namePortion: '$q',
|
|
101
|
+
description: 'Fuller form of name (NR)',
|
|
102
|
+
portion: 'N',
|
|
103
|
+
preceedingPunctuation: 'comma',
|
|
104
|
+
exceptions: ''
|
|
105
|
+
}, {
|
|
106
|
+
selector: '[1457]11',
|
|
107
|
+
namePortion: '$q',
|
|
108
|
+
description: 'Name of meeting following jurisdiction name entry element (NR)',
|
|
109
|
+
portion: 'N',
|
|
110
|
+
preceedingPunctuation: '',
|
|
111
|
+
exceptions: ''
|
|
112
|
+
}, {
|
|
113
|
+
selector: '[1457](00|11)',
|
|
114
|
+
namePortion: '$u',
|
|
115
|
+
description: 'Affiliation (NR)',
|
|
116
|
+
portion: 'N',
|
|
117
|
+
preceedingPunctuation: 'period',
|
|
118
|
+
exceptions: '?'
|
|
119
|
+
}, {
|
|
120
|
+
selector: '[1457]10',
|
|
121
|
+
namePortion: '$u',
|
|
122
|
+
description: 'Affiliation (NR) or Address',
|
|
123
|
+
portion: 'N',
|
|
124
|
+
preceedingPunctuation: 'period',
|
|
125
|
+
exceptions: '- period, if address'
|
|
126
|
+
}, {
|
|
127
|
+
selector: '[1457](00|10|11)',
|
|
128
|
+
namePortion: '$4',
|
|
129
|
+
description: 'Relator code (R)',
|
|
130
|
+
portion: 'NC',
|
|
131
|
+
preceedingPunctuation: 'none',
|
|
132
|
+
exceptions: ''
|
|
133
|
+
}, {
|
|
134
|
+
selector: '[1457](00|10|11)',
|
|
135
|
+
namePortion: '$f',
|
|
136
|
+
description: 'Date of a work (NR)',
|
|
137
|
+
portion: 'T',
|
|
138
|
+
preceedingPunctuation: 'period',
|
|
139
|
+
exceptions: ''
|
|
140
|
+
}, {
|
|
141
|
+
selector: '[1457](00|10|11)',
|
|
142
|
+
namePortion: '$h',
|
|
143
|
+
description: 'Medium (NR)',
|
|
144
|
+
portion: 'T',
|
|
145
|
+
preceedingPunctuation: 'period',
|
|
146
|
+
exceptions: ''
|
|
147
|
+
}, {
|
|
148
|
+
selector: '[457](00|10|11)',
|
|
149
|
+
namePortion: '$i',
|
|
150
|
+
description: 'Relationship information (R)',
|
|
151
|
+
portion: 'cf',
|
|
152
|
+
preceedingPunctuation: 'none',
|
|
153
|
+
exceptions: ''
|
|
154
|
+
}, {
|
|
155
|
+
selector: '[1457](00|10|11)',
|
|
156
|
+
namePortion: '$k',
|
|
157
|
+
description: 'Form subheading (R)',
|
|
158
|
+
portion: 'T',
|
|
159
|
+
preceedingPunctuation: 'period',
|
|
160
|
+
exceptions: ''
|
|
161
|
+
}, {
|
|
162
|
+
selector: '[1457](00|10|11)',
|
|
163
|
+
namePortion: '$l',
|
|
164
|
+
description: 'Language of a work (NR)',
|
|
165
|
+
portion: 'T',
|
|
166
|
+
preceedingPunctuation: 'comma / period',
|
|
167
|
+
exceptions: '- Finnish MARC21 comma,\n- MARC21 period'
|
|
168
|
+
}, {
|
|
169
|
+
selector: '[1457](00|10|11)',
|
|
170
|
+
namePortion: '$m',
|
|
171
|
+
description: 'Medium of performance for music',
|
|
172
|
+
portion: 'T',
|
|
173
|
+
preceedingPunctuation: 'comma',
|
|
174
|
+
exceptions: ''
|
|
175
|
+
}, {
|
|
176
|
+
selector: '[1457](00|10|11)',
|
|
177
|
+
namePortion: '$n',
|
|
178
|
+
description: 'Number of part/section of a work (R)',
|
|
179
|
+
portion: 'T',
|
|
180
|
+
preceedingPunctuation: 'comma, period',
|
|
181
|
+
exceptions: ' - depends on data?\n- period, if preceded by $k, $m, $t\n- comma, if preceded by $b, $m'
|
|
182
|
+
}, {
|
|
183
|
+
selector: '[1457](00|10)',
|
|
184
|
+
namePortion: '$o',
|
|
185
|
+
description: 'Arranged statement for music (NR)',
|
|
186
|
+
portion: 'T',
|
|
187
|
+
preceedingPunctuation: 'semicolon',
|
|
188
|
+
exceptions: ''
|
|
189
|
+
}, {
|
|
190
|
+
selector: '[1457](00|10|11)',
|
|
191
|
+
namePortion: '$p',
|
|
192
|
+
description: 'Name of part/section of a work (R)',
|
|
193
|
+
portion: 'T',
|
|
194
|
+
preceedingPunctuation: 'comma, period, none',
|
|
195
|
+
exceptions: '- depends on data?\n- period if preceded by $t, $n, $p\n- comma, if preceded by $n\n- none, if preceded by $k'
|
|
196
|
+
}, {
|
|
197
|
+
selector: '[1457](00|10)',
|
|
198
|
+
namePortion: '$r',
|
|
199
|
+
description: 'Key for music (NR)',
|
|
200
|
+
portion: 'T',
|
|
201
|
+
preceedingPunctuation: 'comma',
|
|
202
|
+
exceptions: ''
|
|
203
|
+
}, {
|
|
204
|
+
selector: '[1457](00|10|11)',
|
|
205
|
+
namePortion: '$s',
|
|
206
|
+
description: 'Version (NR)',
|
|
207
|
+
portion: 'T',
|
|
208
|
+
preceedingPunctuation: 'period',
|
|
209
|
+
exceptions: ''
|
|
210
|
+
}, {
|
|
211
|
+
selector: '[1457](00|10|11)',
|
|
212
|
+
namePortion: '$t',
|
|
213
|
+
description: 'Title of a work (NR)',
|
|
214
|
+
portion: 'T',
|
|
215
|
+
preceedingPunctuation: 'none',
|
|
216
|
+
exceptions: '- usually first in section -> period'
|
|
217
|
+
}, {
|
|
218
|
+
selector: '[1457](10|11)',
|
|
219
|
+
namePortion: '$d',
|
|
220
|
+
description: 'Date of meeting or treaty signing (R)',
|
|
221
|
+
portion: 'NT',
|
|
222
|
+
preceedingPunctuation: '',
|
|
223
|
+
exceptions: ''
|
|
224
|
+
}, {
|
|
225
|
+
selector: '[1457](00|10|11)',
|
|
226
|
+
namePortion: '$g',
|
|
227
|
+
description: 'Miscellaneous information (NR)',
|
|
228
|
+
portion: 'NT',
|
|
229
|
+
preceedingPunctuation: 'comma',
|
|
230
|
+
exceptions: '- colon, if preceded by $d'
|
|
231
|
+
}, {
|
|
232
|
+
selector: '[1457]10',
|
|
233
|
+
namePortion: '$g',
|
|
234
|
+
description: 'Miscellaneous information (NR), other party to treaties.',
|
|
235
|
+
portion: 'NT',
|
|
236
|
+
preceedingPunctuation: 'comma',
|
|
237
|
+
exceptions: '- colon, if preceded by $d\n- period, if preceded by $t'
|
|
238
|
+
}, {
|
|
239
|
+
selector: '[1457](10|11)',
|
|
240
|
+
namePortion: '$n',
|
|
241
|
+
description: 'Number of part/section/meeting (R)',
|
|
242
|
+
portion: 'NT',
|
|
243
|
+
preceedingPunctuation: '',
|
|
244
|
+
exceptions: ''
|
|
245
|
+
}, {
|
|
246
|
+
selector: '[1457](00|10|11)',
|
|
247
|
+
namePortion: '$v',
|
|
248
|
+
description: 'Form subdivision (R) [600]',
|
|
249
|
+
portion: 'S',
|
|
250
|
+
preceedingPunctuation: 'none',
|
|
251
|
+
exceptions: ''
|
|
252
|
+
}, {
|
|
253
|
+
selector: '[1457](00|10|11)',
|
|
254
|
+
namePortion: '$x',
|
|
255
|
+
description: 'General subdivision (R) [600]',
|
|
256
|
+
portion: 'S',
|
|
257
|
+
preceedingPunctuation: 'none',
|
|
258
|
+
exceptions: ''
|
|
259
|
+
}, {
|
|
260
|
+
selector: '[1457](00|10|11)',
|
|
261
|
+
namePortion: '$y',
|
|
262
|
+
description: 'Chronological subdivision (R) [600]',
|
|
263
|
+
portion: 'S',
|
|
264
|
+
preceedingPunctuation: 'none',
|
|
265
|
+
exceptions: ''
|
|
266
|
+
}, {
|
|
267
|
+
selector: '[1457](00|10|11)',
|
|
268
|
+
namePortion: '$z',
|
|
269
|
+
description: 'Geographic subdivision (R) [600]',
|
|
270
|
+
portion: 'S',
|
|
271
|
+
preceedingPunctuation: 'none',
|
|
272
|
+
exceptions: ''
|
|
273
|
+
}, {
|
|
274
|
+
selector: '[457](00|10|11)',
|
|
275
|
+
namePortion: '$w',
|
|
276
|
+
description: '',
|
|
277
|
+
portion: 'cf',
|
|
278
|
+
preceedingPunctuation: 'none',
|
|
279
|
+
exceptions: ''
|
|
280
|
+
}, {
|
|
281
|
+
selector: '[1457](00|10|11)',
|
|
282
|
+
namePortion: '$0',
|
|
283
|
+
description: 'Authority record control number (R)',
|
|
284
|
+
portion: 'cf',
|
|
285
|
+
preceedingPunctuation: 'none',
|
|
286
|
+
exceptions: ''
|
|
287
|
+
}, {
|
|
288
|
+
selector: '7(00|10|11)',
|
|
289
|
+
namePortion: '$2',
|
|
290
|
+
description: 'Source of heading or term (NR)',
|
|
291
|
+
portion: 'cf',
|
|
292
|
+
preceedingPunctuation: 'none',
|
|
293
|
+
exceptions: ''
|
|
294
|
+
}, {
|
|
295
|
+
selector: '[1457](00|10|11)',
|
|
296
|
+
namePortion: '$5',
|
|
297
|
+
description: 'Institution to which field applies (NR)',
|
|
298
|
+
portion: 'cf',
|
|
299
|
+
preceedingPunctuation: 'none',
|
|
300
|
+
exceptions: ''
|
|
301
|
+
}, {
|
|
302
|
+
selector: '[1457](00|10|11)',
|
|
303
|
+
namePortion: '$6',
|
|
304
|
+
description: 'Linkage (NR)',
|
|
305
|
+
portion: 'cf',
|
|
306
|
+
preceedingPunctuation: 'none',
|
|
307
|
+
exceptions: ''
|
|
308
|
+
}, {
|
|
309
|
+
selector: '[1457](00|10|11)',
|
|
310
|
+
namePortion: '$7',
|
|
311
|
+
description: 'Control subfield (NR)',
|
|
312
|
+
portion: 'cf',
|
|
313
|
+
preceedingPunctuation: 'none',
|
|
314
|
+
exceptions: ''
|
|
315
|
+
}, {
|
|
316
|
+
selector: '[1457](00|10|11)',
|
|
317
|
+
namePortion: '$8',
|
|
318
|
+
description: 'Field link and sequence number (R)',
|
|
319
|
+
portion: 'cf',
|
|
320
|
+
preceedingPunctuation: 'none',
|
|
321
|
+
exceptions: ''
|
|
322
|
+
}, {
|
|
323
|
+
selector: '[1457](00|10|11)',
|
|
324
|
+
namePortion: '$9',
|
|
325
|
+
description: 'Local control subfield',
|
|
326
|
+
portion: 'cf',
|
|
327
|
+
preceedingPunctuation: 'none',
|
|
328
|
+
exceptions: ''
|
|
329
|
+
}];
|
|
330
|
+
var _default = autRules;
|
|
331
|
+
exports.default = _default;
|
|
332
|
+
//# sourceMappingURL=aut.js.map
|