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
- Enter tokens, quotationStart, quotationEnd, before, after. Use the units and conventions below.
- Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
- 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 field | Meaning and units | Accepted input |
|---|---|---|
| tokens | Tokens | Required. Array of text; maximum UTF-16 length 8192; maximum items 256. |
| quotationStart | Zero-based inclusive token start. | Required. Safe integer; minimum 0. |
| quotationEnd | Zero-based exclusive token end. | Required. Safe integer. |
| before | Before | Required. Safe integer; minimum 0. |
| after | After | Required. Safe integer; minimum 0. |
| Output field | Interpretation | Returned shape |
|---|---|---|
| contextStart | Context Start | Required. Safe integer. |
| contextEnd | Context End | Required. Safe integer. |
| contextLength | Context Length | Required. Safe integer. |
{
"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
Similar or alternative tools
- Quotation Ellipsis Span Gap
Compare an original span with a quotation and declared omission.
- Discourse Annotation Scope Gap
Partition a half-open annotation span against a context span.