Skip to content

Main content

Excerpt Context Window Offset Tool

Expand supplied half-open character offsets within an explicit text extent.

Loading tool…

Description

Return clipped context bounds around an excerpt.

Cultural source records can encode exact tokens, voices, time offsets and context budgets. Their literal structure can be summarized without determining authorship, cultural meaning, source authority or adequacy of interpretation.

Return clipped context bounds around an excerpt.

When to use this tool

Use Excerpt Context Window Offset when checking a supplied source-context or annotation convention.

How to use the tool and how it works

  1. Enter excerptStart, excerptEnd, contextBefore, contextAfter, textLength. 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 contextStart, contextEnd, excerptOffset. Use the output convention below.

Return clipped context bounds around an excerpt. Require whole ordered offsets inside textLength and nonnegative context counts; clamp start/end to the text and return excerptOffset relative to contextStart.1

Input fieldMeaning and unitsAccepted input
excerptStartExcerpt StartRequired. Safe integer; minimum 0.
excerptEndExcerpt EndRequired. Safe integer.
contextBeforeContext BeforeRequired. Safe integer; minimum 0.
contextAfterContext AfterRequired. Safe integer; minimum 0.
textLengthText LengthRequired. Safe integer; minimum 0.
Output fieldInterpretationReturned shape
contextStartContext StartRequired. Safe integer.
contextEndContext EndRequired. Safe integer.
excerptOffsetExcerpt OffsetRequired. Safe integer.
json
{
  "input": {
    "excerptStart": 5,
    "excerptEnd": 10,
    "contextBefore": 3,
    "contextAfter": 4,
    "textLength": 12
  },
  "output": {
    "contextStart": 2,
    "contextEnd": 12,
    "excerptOffset": 3
  }
}

Limitations and assumptions

  • Offsets use a supplied text-unit convention; no text extraction, Unicode unit conversion or context interpretation occurs.
  • 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.
  • Numeric calculations use binary floating point unless exact decimal-integer arithmetic is explicitly stated. No hidden measurement tolerance or decimal rounding is added; nonfinite or out-of-contract results are rejected. Numeric signed-zero results are exported as zero.

Alternative or Complementary methods

Review the actual sources and relevant participant or community context for substantive interpretation and attribution.

References

  1. Calculation and input contract: cultural-studies/excerpt-context-window-offset — tool.io

Similar or alternative tools