Description
Locate exact target tokens and count their bounded context windows.
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.
Locate exact target tokens and count their bounded context windows.
When to use this tool
Use Source Term Context Count when checking a supplied source-context or annotation convention.
How to use the tool and how it works
- Enter tokens, target, 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 matchingPositions, contextTokenCounts. Use the output convention below.
Locate exact target tokens and count their bounded context windows. Require nonnegative whole before/after; for each match count clipped positions before through after, including the target.1
| Input field | Meaning and units | Accepted input |
|---|---|---|
| tokens | Tokens | Required. Array of text; maximum UTF-16 length 8192; maximum items 256. |
| target | Target | Required. Text; maximum UTF-16 length 8192. |
| before | Before | Required. Safe integer; minimum 0. |
| after | After | Required. Safe integer; minimum 0. |
| Output field | Interpretation | Returned shape |
|---|---|---|
| matchingPositions | Matching Positions | Required. Array of safe integer; maximum items 256. |
| contextTokenCounts | Context Token Counts | Required. Array of safe integer; maximum items 256. |
{
"input": {
"tokens": [
"a",
"x",
"b",
"x"
],
"target": "x",
"before": 1,
"after": 1
},
"output": {
"matchingPositions": [
1,
3
],
"contextTokenCounts": [
3,
2
]
}
} Limitations and assumptions
- Windows are counted independently and can overlap; no semantic, discourse or representative-context analysis 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
Similar or alternative tools
- Quotation Context Expansion Budget
Return expanded quotation length and budget slack.
- Excerpt Context Window Offset
Return clipped context bounds around an excerpt.