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
- XLINK_NAMESPACE =
XLink, which MODS uses for the @xlink:href a display hyperlinks an element to. Held as a bare URI rather than a prefix map because the attribute is read by namespace: a document may bind XLink to any prefix it likes.
"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
.versionfile at the repo root at load time (mirrors the atlas_rb convention so a single.versionbump drives the gem version +bundler/gem_tasksrelease). File.read(File.("../../../.version", __dir__)).strip
Class Method Summary collapse
- .canonical_lines(str) ⇒ Object
-
.canonical_ws(str) ⇒ Object
Whitespace no-op guard (see Canonicalize).
-
.compose_title(parts) ⇒ Object
Pure display-title composition over a primary-title parts hash (see Projection.compose_title).
-
.normalize(str) ⇒ Object
Curator-freetext normalization for the access copy (see TextNormalizer).
- .normalize_paragraphs(str) ⇒ Object
- .whitespace_equivalent?(current, incoming) ⇒ Boolean
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
44 |
# File 'lib/neu-mods.rb', line 44 def whitespace_equivalent?(current, incoming) = Canonicalize.whitespace_equivalent?(current, incoming) |