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

Defined Under Namespace

Modules: Canonicalize, 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
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_ws(str) ⇒ Object

Whitespace no-op guard (see Canonicalize).



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

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.



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

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

.normalize(str) ⇒ Object

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



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

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

.normalize_paragraphs(str) ⇒ Object



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

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

.whitespace_equivalent?(current, incoming) ⇒ Boolean

Returns:

  • (Boolean)


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

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