Skip to content

Main content

Unicode Script Transition Count Tool

Count transitions in supplied Unicode script annotations after explicit ignored-label removal; does not infer scripts from text.

Loading tool…

Description

Count transitions in supplied Unicode script annotations after explicit ignored-label removal; does not infer scripts from text.

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.

Count transitions in supplied Unicode script annotations after explicit ignored-label removal; does not infer scripts from text.

When to use this tool

Use Unicode Script Transition Count 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

  1. Enter scriptLabels, ignoredLabels. Keep parallel arrays aligned. Use the units and conventions below.
  2. Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
  3. Read transitions, retainedLabels. Use the output convention below.

Remove supplied scriptLabels occurring in ignoredLabels, then count adjacent changes in the retained list and return retainedLabels.1

Input fieldMeaning and unitsAccepted input
scriptLabelsScript LabelsRequired. Array of text; maximum UTF-16 length 8192; maximum items 256.
ignoredLabelsIgnored LabelsRequired. Array of text; maximum UTF-16 length 8192; maximum items 256.
Output fieldInterpretationReturned shape
transitionsTransitionsRequired. Safe integer.
retainedLabelsRetained LabelsRequired. Array of text; maximum UTF-16 length 8192; maximum items 256.
json
{
  "input": {
    "scriptLabels": [
      "Latin",
      "Common",
      "Greek",
      "Greek",
      "Latin"
    ],
    "ignoredLabels": [
      "Common"
    ]
  },
  "output": {
    "transitions": 2,
    "retainedLabels": [
      "Latin",
      "Greek",
      "Greek",
      "Latin"
    ]
  }
}

Limitations and assumptions

  • Filtering can make labels formerly separated by ignored entries adjacent. Labels are supplied, not derived from text or verified against Unicode script properties.
  • 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

  1. Calculation and input contract: text/unicode-script-transition-count — tool.io

Similar or alternative tools