Spanish Inverted Punctuation Placement Rule
Audit actual properly nested Spanish inverted/closing question and exclamation marks with source code-point indices; matching is structural only, not a claim about where a grammatical interrogative begins or missing punctuation in unmarked prose.
Description
Spanish inverted punctuation can be checked for structural pairing.
Spanish inverted punctuation can be checked for structural pairing. Balanced marks do not identify the grammatical scope of a question or exclamation.1
Enter plain text. Scan Unicode code points with a stack for ¿/? and ¡/!; return matched count and remaining opening/mismatched closing indices, plus balance flag.
When to use Spanish Inverted Punctuation Placement Rule
Use Spanish Inverted Punctuation Placement Rule when you need to evaluate the supplied records under the calculation and evidence rules below. Indices count code points, not UTF-16 units. Unmarked prose can be structurally balanced; grammar and missing punctuation are not inferred.
Prepare explicit text tokens, annotated language observations, caller mappings or a supported locale as requested. Preserve source evidence and the stated Unicode counting convention.
How to use Spanish Inverted Punctuation Placement Rule and understand its results
- Prepare explicit text tokens, annotated language observations, caller mappings or a supported locale as requested. Preserve source evidence and the stated Unicode counting convention.
- Enter plainSpanishText using the field table and calculation rules, then run the tool.
- Read matchedInvertedPunctuationPairCount, unmatchedOpeningCodePointIndices, unmatchedClosingCodePointIndices, observedInvertedPairsBalanced. The explanation below defines the units, signs, ordering and any flags or placeholder values.
- If the tool reports an input issue, correct the values and run it again. Apply the stated assumptions when interpreting a successfully returned result.
| Input field | Meaning | Value type; see rules below | Requirement |
|---|---|---|---|
| plainSpanishText | Plain spanish text | string | Required |
Enter plain text. Scan Unicode code points with a stack for ¿/? and ¡/!; return matched count and remaining opening/mismatched closing indices, plus balance flag.
close matches only the most recent compatible opening mark Units, indexing, boundary conditions and exceptional cases are defined in the calculation rules above.
| Output field | Meaning | Value type |
|---|---|---|
| matchedInvertedPunctuationPairCount | Matched inverted punctuation pair count | number |
| unmatchedOpeningCodePointIndices | Unmatched opening code point indices | list of number |
| unmatchedClosingCodePointIndices | Unmatched closing code point indices | list of number |
| observedInvertedPairsBalanced | Observed inverted pairs balanced | boolean |
{
"input": {
"plainSpanishText": "¿Qué? ¡Sí!"
},
"output": {
"matchedInvertedPunctuationPairCount": 2,
"unmatchedOpeningCodePointIndices": [],
"unmatchedClosingCodePointIndices": [],
"observedInvertedPairsBalanced": true
}
} Limitations and assumptions
Indices count code points, not UTF-16 units. Unmarked prose can be structurally balanced; grammar and missing punctuation are not inferred.
Numeric inputs, where present, must be finite. Follow the calculation-specific rules for overflow, underflow and exceptional cases. Extremely large text inputs are rejected. Missing required fields, extra fields, wrong value types and violations of the calculation rules are input errors. A successfully returned false flag is an evaluated outcome; its meaning is explained above.
Alternative or Complementary methods
Use Greek Question Mark Semicolon Quirk: Greek question-mark code point U+037E is canonically equivalent to a semicolon. Interpreting semicolons as questions requires the caller’s Greek context. For a complementary task, use French Space-Before-Punctuation Rule: French punctuation spacing follows a declared style and region. Nonbreaking and narrow nonbreaking spaces have different layout behavior.
References
Similar or alternative tools
- Greek Question Mark Semicolon Quirk
Greek question-mark code point U+037E is canonically equivalent to a semicolon. Interpreting semicolons as questions requires the caller’s Greek context.
- French Space-Before-Punctuation Rule
French punctuation spacing follows a declared style and region. Nonbreaking and narrow nonbreaking spaces have different layout behavior.