Skip to content

Main content

OCR Hyphen Join Marker

Join explicit OCR line fragments, removing a final ASCII hyphen only when it is explicitly marked discretionary.

Loading tool…

Description

Join two supplied line fragments under a discretionary-hyphen flag.

Digital editions separate source readings, editorial uncertainty, witness locators, image requests, identifiers and rights statements. XML character/attribute rules differ from display labels, while URI fragments and TEI pointers need their target-document context. An identifier key or formatted token does not authenticate a witness, validate an edition or authorize reuse.

Join two supplied line fragments under a discretionary-hyphen flag.

When to use this tool

Use OCR Hyphen Join Marker when you already have lineEndText, nextLineStartText, discretionaryHyphen and need to join two supplied line fragments under a discretionary-hyphen flag.

How to use the tool and how it works

  1. Enter lineEndText, nextLineStartText, discretionaryHyphen. Use the units and conventions below.
  2. Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
  3. Read joinedText, hyphenRemoved. Inspect hyphenRemoved before interpreting the associated values.

If discretionaryHyphen=true require an ASCII hyphen at the end of lineEndText, remove exactly that final hyphen, then append nextLineStartText; otherwise concatenate unchanged.1

Input fieldMeaning and unitsAccepted input
lineEndTextLine End TextRequired. Text; maximum UTF-16 length 8192.
nextLineStartTextNext Line Start TextRequired. Text; maximum UTF-16 length 8192.
discretionaryHyphenTrue requires a final ASCII - and removes exactly it; false leaves any hyphen intact.Required. Boolean.
Output fieldInterpretationReturned shape
joinedTextJoined TextRequired. Text; maximum UTF-16 length 8192.
hyphenRemovedHyphen RemovedRequired. Boolean.
json
{
  "input": {
    "lineEndText": "inter-",
    "nextLineStartText": "national",
    "discretionaryHyphen": true
  },
  "output": {
    "joinedText": "international",
    "hyphenRemoved": true
  }
}

Limitations and assumptions

  • No whitespace is inserted or trimmed. No OCR, word boundary, language, hyphen type or editorially correct joining is inferred.
  • Inputs must satisfy both the field types and the cross-field conditions above. Invalid input causes an error; a successful false flag or documented placeholder is a different result.

Alternative or Complementary methods

Validate the complete XML/TEI document or IIIF request when technical conformance matters, and inspect the original witness and rights record for editorial use. Preserve uncertain readings, source order and attribution rather than treating local tokens as verified scholarly interpretations.

References

  1. Calculation and input contract: digital-humanities/ocr-hyphen-join-marker — tool.io

Similar or alternative tools