Module: NEU::MODS

Defined in:
lib/neu-mods.rb,
lib/neu/mods/version.rb,
lib/neu/mods/document.rb,
lib/neu/mods/selectors.rb,
lib/neu/mods/projection.rb,
lib/neu/mods/canonicalize.rb,
lib/neu/mods/language_codes.rb

Defined Under Namespace

Modules: Canonicalize, LanguageCodes, Projection, Selectors, TextNormalizer Classes: Document

Constant Summary collapse

NAMESPACE =

The MODS v3 namespace, as a Nokogiri xpath namespace hash.

{ "mods" => "http://www.loc.gov/mods/v3" }.freeze
"http://www.w3.org/1999/xlink"
FIELDS =

The projected field set and its cardinality (see Projection::FIELDS), surfaced here so a consumer deriving its own schema from it -- Atlas's Metadata::MODS attr_json set -- reads the shared contract off the top-level module instead of reaching into a mixin.

Projection::FIELDS
VERSION =

Current gem version, read from the .version file at the repo root at load time (mirrors the atlas_rb convention so a single .version bump drives the gem version + bundler/gem_tasks release).

File.read(File.expand_path("../../../.version", __dir__)).strip

Class Method Summary collapse

Class Method Details

.canonical_lines(str) ⇒ Object



43
# File 'lib/neu-mods.rb', line 43

def canonical_lines(str) = Canonicalize.canonical_lines(str)

.canonical_ws(str) ⇒ Object

Whitespace no-op guard (see Canonicalize).



42
# File 'lib/neu-mods.rb', line 42

def canonical_ws(str) = Canonicalize.canonical_ws(str)

.compose_title(parts) ⇒ Object

Pure display-title composition over a primary-title parts hash (see Projection.compose_title). Lets a caller that already holds the parts -- e.g. Atlas's access-copy model -- compose the title without parsing XML.



53
# File 'lib/neu-mods.rb', line 53

def compose_title(parts) = Projection.compose_title(parts)

.normalize(str) ⇒ Object

Curator-freetext normalization for the access copy (see TextNormalizer).



47
# File 'lib/neu-mods.rb', line 47

def normalize(str) = TextNormalizer.normalize(str)

.normalize_paragraphs(str) ⇒ Object



48
# File 'lib/neu-mods.rb', line 48

def normalize_paragraphs(str) = TextNormalizer.normalize_paragraphs(str)

.whitespace_equivalent?(current, incoming) ⇒ Boolean

Returns:

  • (Boolean)


44
# File 'lib/neu-mods.rb', line 44

def whitespace_equivalent?(current, incoming) = Canonicalize.whitespace_equivalent?(current, incoming)