Description
Crosswalk a supplied one-based dependency head with a root sentinel.
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.
Crosswalk a supplied one-based dependency head with a root sentinel.
When to use this tool
Use Dependency One Based Head Crosswalk when you already have headOneBased, tokenCount and need to crosswalk a supplied one-based dependency head with a root sentinel.
How to use the tool and how it works
- Enter headOneBased, tokenCount. Use the units and conventions below.
- Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
- Read root, headZeroBased. Inspect root before interpreting the associated values.
Require safe tokenCount>=0 and headOneBased in [0,count]; root=head===0, headZeroBased=-1 for root or head-1 otherwise.1
CoNLL-U uses zero for the virtual root in the HEAD column. Converting that local index does not validate a dependency tree.2
| Input field | Meaning and units | Accepted input |
|---|---|---|
| headOneBased | Zero means root; otherwise a one-based head no greater than tokenCount. | Required. Safe integer; minimum 0. |
| tokenCount | Token Count | Required. Safe integer; minimum 0. |
| Output field | Interpretation | Returned shape |
|---|---|---|
| root | Root | Required. Boolean. |
| headZeroBased | headOneBased-1 for nonroot, or -1 sentinel for root. | Required. Safe integer. |
{
"input": {
"headOneBased": 3,
"tokenCount": 5
},
"output": {
"root": false,
"headZeroBased": 2
}
} Limitations and assumptions
- Minus one is a sentinel, not an array index. No token identity, self-head, cycle, connectivity, root count or valid dependency tree is checked.
- 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
- CoNLL-U Range Token Boundary
Parse a supplied CoNLL-U-style multiword range ID.
- CoNLL-U Decimal Empty Node Key
Split a supplied CoNLL-U-style decimal empty-node ID.