Class MarcClassificationAnalyzer
java.lang.Object
de.gwdg.metadataqa.marc.analysis.contextual.ContextualAnalyzer<ClassificationStatistics>
de.gwdg.metadataqa.marc.analysis.contextual.classification.ClassificationAnalyzer
de.gwdg.metadataqa.marc.analysis.contextual.classification.MarcClassificationAnalyzer
- Direct Known Subclasses:
Marc21ClassificationAnalyzer, UnimarcClassificationAnalyzer
Primarily used to encompass methods that are common to MARC classification analyzers (Marc21ClassificationAnalyzer
and UnimarcClassificationAnalyzer), so that code duplication is minimized.
-
Field Summary
Fields inherited from class ClassificationAnalyzer
classificationSchemes, parametersFields inherited from class ContextualAnalyzer
bibliographicRecord, NUMERIC_REGEX, schemasInRecord, statistics -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedMarcClassificationAnalyzer(BibliographicRecord bibliographicRecord, ClassificationStatistics statistics) -
Method Summary
Modifier and TypeMethodDescriptionextractSchemasFromSubfield2(String tag, DataField field) Extracts the scheme from the subfield 2 of the current field.protected intprocessFieldWithSchema(BibliographicRecord marcRecord, FieldWithScheme fieldEntry) protected intprocessFieldWithSubfield2(BibliographicRecord marcRecord, String tag) The source is specified in the subfield 2.Methods inherited from class ClassificationAnalyzer
getCollocationInRecord, getSchemasInRecord, increaseCounters, processMethods inherited from class ContextualAnalyzer
addSchemasToStatistics, deduplicateSchema, registerSchemas, updateSchemaSubfieldStatistics
-
Constructor Details
-
MarcClassificationAnalyzer
protected MarcClassificationAnalyzer(BibliographicRecord bibliographicRecord, ClassificationStatistics statistics)
-
-
Method Details
-
processFieldWithSubfield2
The source is specified in the subfield 2. For each field with the specified tag, extract the schema from the subfield 2 and update the statistics.- Parameters:
marcRecord- The current record to extract schemas fromtag- The tag of the current field where the schema is extracted from- Returns:
- The number of schemas extracted from the current field
-
extractSchemasFromSubfield2
Extracts the scheme from the subfield 2 of the current field. If the subfield 2 is not present, a new schema is created with the value "undetectable". Otherwise, a new schema is created for each subfield 2 found.- Parameters:
tag- The tag of the current fieldfield- The current field from which the subfield 2 is extracted- Returns:
- The schemas extracted from the subfield 2
-
processFieldWithSchema
-