Description
Apply explicit quote-token roles and a supplied symmetric-quote policy without guessing linguistic nesting.
Text positions can be measured in UTF-16 code units, Unicode code points, grapheme clusters, or modeled display columns. These coordinates are not interchangeable. Invisible markers and delimiter policies can also affect interpretation even when a string looks unchanged, so the chosen representation needs to stay explicit.
Apply explicit quote-token roles and a supplied symmetric-quote policy without guessing linguistic nesting.
When to use this tool
Use Quotation Mark Nesting Role when you need the stated marker, coordinate, delimiter, or normalization operation under an explicit text representation.
How to use the tool and how it works
- Enter token, opening, closing, depth, symmetricRole. Use the units and conventions below.
- Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
- Read role, nextDepth. Use the output convention below.
Classify token against nonempty opening and closing labels, using symmetricRole when they coincide. Advance or reduce nonnegative integer depth accordingly, rejecting a close at depth zero.1
| Input field | Meaning and units | Accepted input |
|---|---|---|
| token | Token | Required. Text; maximum UTF-16 length 8192. |
| opening | Opening | Required. Text; maximum UTF-16 length 8192. |
| closing | Closing | Required. Text; maximum UTF-16 length 8192. |
| depth | Depth | Required. Safe integer; minimum 0. |
| symmetricRole | Symmetric Role | Required. Text; one of "open", "close"; maximum UTF-16 length 8192. |
| Output field | Interpretation | Returned shape |
|---|---|---|
| role | Role | Required. Text; maximum UTF-16 length 8192. |
| nextDepth | Next Depth | Required. Safe integer. |
{
"input": {
"token": "“",
"opening": "“",
"closing": "”",
"depth": 0,
"symmetricRole": "open"
},
"output": {
"role": "open",
"nextDepth": 1
}
} Limitations and assumptions
- An unrecognized token keeps depth unchanged. The symmetric role is explicit rather than inferred from text, and this checks one transition without parsing a full quotation structure.
- The field tables state structural bounds; the mechanics also specify cross-field constraints. Malformed inputs and unsupported domains cause errors. A successful false flag, empty branch value, or zero placeholder has the meaning stated above and is distinct from an input error.
Alternative or Complementary methods
Choose the coordinate system required by the consumer. Use a full parser, renderer, or segmentation method when a local marker or delimiter rule cannot determine the complete text behavior.
References
Similar or alternative tools
- Text: Combining Mark Leading Position Flag
Check whether the first scalar of a string has Unicode Mark general category using the runtime Unicode property table; not grapheme segmentation or a validity judgment.
- Typographic Quote Nesting Pair
Alternate curly double and single opening/closing quotes by nonnegative integer depth, with doubleOuter selecting which pair appears at even depth.