Description
Adjust a supplied source offset for preceding one-unit newline expansions.
Language-processing records distinguish tokens, code points, UTF-16 positions and UTF-8 byte offsets. Tag grammars and local transition checks do not validate a full annotation sequence. Log-loss units determine perplexity conversion, while identifier suffixes may be textual labels rather than ordinary decimal numbers.
Adjust a supplied source offset for preceding one-unit newline expansions.
When to use this tool
Use Corpus Character Offset Newline Adjustment when you already have originalOffset, precedingExpandedNewlines and need to adjust a supplied source offset for preceding one-unit newline expansions.
How to use the tool and how it works
- Enter originalOffset, precedingExpandedNewlines. Use the units and conventions below.
- Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
- Read adjustedOffset. Use the output convention below.
Require nonnegative safe originalOffset and precedingExpandedNewlines<=offset; add them with BigInt and export a safe integer.1
| Input field | Meaning and units | Accepted input |
|---|---|---|
| originalOffset | Original Offset | Required. Safe integer; minimum 0. |
| precedingExpandedNewlines | Preceding Expanded Newlines | Required. Safe integer; minimum 0. |
| Output field | Interpretation | Returned shape |
|---|---|---|
| adjustedOffset | Exact originalOffset+precedingExpandedNewlines; each newline contributes one extra unit, with safe numeric export. | Required. Safe integer. |
{
"input": {
"originalOffset": 20,
"precedingExpandedNewlines": 3
},
"output": {
"adjustedOffset": 23
}
} Limitations and assumptions
- Each counted expansion contributes exactly one index unit. No source/newline scan, offset-unit convention or actual span is verified; unsafe exports are rejected.
- 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
Validate the complete corpus format, tokenizer, annotation sequence and scoring convention. Use a full parser or model evaluation when needed, preserving the exact offset unit, vocabulary and log base rather than inferring them from a local transformation.
References
Similar or alternative tools
- Morpheme Boundary Byte Offset
Count UTF-8 bytes preceding a supplied morpheme boundary.
- Entity Span Inclusive Exclusive Crosswalk
Crosswalk supplied inclusive entity-span endpoints to an exclusive end.