Skip to content

Main content

Quotation Context Window Length Tool

Resolve a half-open supplied quotation token window with bounded context, without interpreting the quotation.

Loading tool…

Description

Clip a quotation context window to a supplied token array.

Quotations and corpora depend on span boundaries, omissions, annotation context and exclusion policies. A clipped window or support count describes supplied records while the adequacy, independence and meaning of their context still require editorial interpretation.

Clip a quotation context window to a supplied token array.

When to use this tool

Use Quotation Context Window Length when checking a supplied quotation, context or corpus-support convention.

How to use the tool and how it works

  1. Enter tokens, quotationStart, quotationEnd, before, after. 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, contextLength. Use the output convention below.

Clip a quotation context window to a supplied token array. Require 0 <= quotationStart <= quotationEnd <= tokens.length and nonnegative whole before/after; contextStart = max(0,start-before), contextEnd = min(length,end+after).1

Input fieldMeaning and unitsAccepted input
tokensTokensRequired. Array of text; maximum UTF-16 length 8192; maximum items 256.
quotationStartZero-based inclusive token start.Required. Safe integer; minimum 0.
quotationEndZero-based exclusive token end.Required. Safe integer.
beforeBeforeRequired. Safe integer; minimum 0.
afterAfterRequired. Safe integer; minimum 0.
Output fieldInterpretationReturned shape
contextStartContext StartRequired. Safe integer.
contextEndContext EndRequired. Safe integer.
contextLengthContext LengthRequired. Safe integer.
json
{
  "input": {
    "tokens": [
      "a",
      "b",
      "c",
      "d",
      "e"
    ],
    "quotationStart": 1,
    "quotationEnd": 3,
    "before": 2,
    "after": 1
  },
  "output": {
    "contextStart": 0,
    "contextEnd": 4,
    "contextLength": 4
  }
}

Limitations and assumptions

  • Indexes describe a half-open token span; tokenization and interpretive adequacy of the resulting context are not assessed.
  • 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

Read the complete sources and audit the annotation/exclusion policy before treating a numerical coverage measure as interpretive support.

References

  1. Calculation and input contract: critical-theory/quotation-context-window-length — tool.io

Similar or alternative tools