File_MARC
[ class tree: File_MARC ] [ index: File_MARC ] [ all elements ]

Class: File_MARC_Lint

Source Location: /File_MARC-1.4.1/File/MARC/Lint.php

Class Overview


Class for testing validity of MARC records against MARC21 standard.


Author(s):

Variables

Methods


Inherited Variables

Inherited Methods


Class Details

[line 52]
Class for testing validity of MARC records against MARC21 standard.


[ Top ]


Class Variables

$data =

[line 66]

A File_MARC_Lint_CodeData object for validating codes
  • Access: protected



[ Top ]

$rules =

[line 60]

Rules used for testing records
  • Access: protected

Type:   array


[ Top ]

$validateIspn =

[line 72]

A Validate_ISPN object for validating ISBN numbers
  • Access: protected

Type:   Validate_ISPN


[ Top ]

$warnings = array()

[line 78]

Warnings generated during analysis
  • Access: protected

Type:   array


[ Top ]



Method Detail

__construct (Constructor)   [line 90]

true __construct( )

Start function

Set up rules for testing MARC records.

  • Access: public

[ Top ]

check020   [line 324]

void check020( File_MARC_Field $field)

Looks at 020$a and reports errors if the check digit is wrong.

Looks at 020$z and validates number if hyphens are present.

  • Access: protected

Parameters:

File_MARC_Field   $field   —  Field to check

[ Top ]

check041   [line 395]

void check041( File_MARC_Field $field)

Warns if subfields are not evenly divisible by 3 unless second indicator is 7

(future implementation would ensure that each subfield is exactly 3 characters unless ind2 is 7--since subfields are now repeatable. This is not implemented here due to the large number of records needing to be corrected.). Validates against the MARC Code List for Languages (<http://www.loc.gov/marc/>).

  • Access: protected

Parameters:

File_MARC_Field   $field   —  Field to check

[ Top ]

check043   [line 439]

void check043( File_MARC_Field $field)

Warns if each subfield a is not exactly 7 characters. Validates each code against the MARC code list for Geographic Areas (<http://www.loc.gov/marc/>).
  • Access: protected

Parameters:

File_MARC_Field   $field   —  Field to check

[ Top ]

check245   [line 483]

void check245( File_MARC_Field $field)

-Makes sure $a exists (and is first subfield).

-Warns if last character of field is not a period --Follows LCRI 1.0C, Nov. 2003 rather than MARC21 rule -Verifies that $c is preceded by / (space-/) -Verifies that initials in $c are not spaced -Verifies that $b is preceded by :;= (space-colon, space-semicolon, space-equals) -Verifies that $h is not preceded by space unless it is dash-space -Verifies that data of $h is enclosed in square brackets -Verifies that $n is preceded by . (period) --As part of that, looks for no-space period, or dash-space-period (for replaced elipses) -Verifies that $p is preceded by , (no-space-comma) when following $n and . (period) when following other subfields. -Performs rudimentary article check of 245 2nd indicator vs. 1st word of 245$a (for manual verification).

Article checking is done by internal checkArticle method, which should work for 130, 240, 245, 440, 630, 730, and 830.

  • Access: protected

Parameters:

File_MARC_Field   $field   —  Field to check

[ Top ]

checkArticle   [line 674]

void checkArticle( File_MARC_Field $field)

Check of articles is based on code from Ian Hamilton. This version is more

limited in that it focuses on English, Spanish, French, Italian and German articles. Certain possible articles have been removed if they are valid English non-articles. This version also disregards 008_language/041 codes and just uses the list of articles to provide warnings/suggestions.

source for articles = <http://www.loc.gov/marc/bibliographic/bdapp-e.html>

Should work with fields 130, 240, 245, 440, 630, 730, and 830. Reports error if another field is passed in.

  • Access: protected

Parameters:

File_MARC_Field   $field   —  Field to check

[ Top ]

checkDuplicate1xx   [line 146]

void checkDuplicate1xx( File_MARC_Record $marc)

Check for multiple 1xx fields.
  • Access: protected

Parameters:

File_MARC_Record   $marc   —  Record to check

[ Top ]

checkIndicators   [line 255]

void checkIndicators( string $tagNo, File_MARC_Field $field, array $rules)

Check the indicators for the provided field.
  • Access: protected

Parameters:

string   $tagNo   —  Tag number being checked
File_MARC_Field   $field   —  Field to check
array   $rules   —  Rules to use for checking

[ Top ]

checkMissing245   [line 166]

void checkMissing245( File_MARC_Record $marc)

Check for missing 245 field.
  • Access: protected

Parameters:

File_MARC_Record   $marc   —  Record to check

[ Top ]

checkRecord   [line 106]

array checkRecord( File_MARC_Record $marc)

Check the provided MARC record and return an array of warning messages.
  • Access: public

Parameters:

File_MARC_Record   $marc   —  Record to check

[ Top ]

checkSubfields   [line 287]

void checkSubfields( string $tagNo, File_MARC_Field $field, array $rules)

Check the subfields for the provided field.
  • Access: protected

Parameters:

string   $tagNo   —  Tag number being checked
File_MARC_Field   $field   —  Field to check
array   $rules   —  Rules to use for checking

[ Top ]

getHumanReadableIndicatorValues   [line 927]

string getHumanReadableIndicatorValues( string $rules)

Turn a set of indicator rules into a human-readable list.
  • Access: protected

Parameters:

string   $rules   —  Indicator rules

[ Top ]

getRawRules   [line 960]

string getRawRules( )

Support method for parseRules() -- get the raw rules from MARC::Lint.
  • Access: protected

[ Top ]

parseRules   [line 846]

void parseRules( )

Support method for constructor to load MARC rules.
  • Access: protected

[ Top ]

processRuleGroup   [line 879]

void processRuleGroup( array $rules)

Support method for parseRules() -- process one group of lines representing a single tag.
  • Access: protected

Parameters:

array   $rules   —  Rule lines to process

[ Top ]

standardFieldChecks   [line 183]

void standardFieldChecks( File_MARC_Record $marc)

Check all fields against the standard rules encoded in the class.
  • Access: protected

Parameters:

File_MARC_Record   $marc   —  Record to check

[ Top ]

warn   [line 132]

void warn( string $warning)

Add a warning.
  • Access: protected

Parameters:

string   $warning   —  Warning to add

[ Top ]


Documentation generated on Wed, 13 Nov 2019 12:37:08 -0500 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.