Cyclic String Reflection Equivalence

Check exact cyclic string reflection equivalence separately from rotation, using UTF-16 reversal rather than grapheme reversal.

Description

Check exact cyclic string reflection equivalence separately from rotation, using UTF-16 reversal rather than grapheme reversal.

Cyclic rotation and reflected rotation are separate equivalence tests for oriented strings.

When to use this tool

Check exact cyclic string reflection equivalence separately from rotation, using UTF-16 reversal rather than grapheme reversal.

  • Prepare the supplied left, right fields for this operation.
  • Compare the complete example with the representation used by your own input before carrying the result into another step.

How to use the tool and how it works

  1. Enter left, right. Use the exact text syntax, units and index conventions explained below.
  2. Run the tool. If input validation fails, correct the supplied fields before interpreting any result.
  3. Read result.rotation, result.reflection. Interpret false, null and empty lists using the distinctions below; they can be valid outputs.

Generate rotations of left and of its code-unit reversal. Return independent flags for whether right occurs in each set.1

Input fieldMeaning and representationAccepted input
leftleft.Text; at most 8,192 UTF-16 code units, subject to the grammar above
rightright.Text; at most 8,192 UTF-16 code units, subject to the grammar above
Output fieldInterpretation
resultObject containing the named outputs below.
result.rotationFlag for rotation under the exact condition described above.
result.reflectionFlag for reflection under the exact condition described above.
json
{
  "input": {
    "left": "abc",
    "right": "acb"
  },
  "output": {
    "result": {
      "rotation": false,
      "reflection": true
    }
  }
}

Limitations and assumptions

  • Both flags may be true. The operation is case-sensitive and code-unit based; lengths must match implicitly for a rotation match.
  • The string-analysis source text is bounded to 128 UTF-16 code units; offsets and lengths use those code units.
  • All declared input fields are required and unexpected top-level fields are rejected. Numbers must be finite; lists are limited to 128 entries and ordinary text fields to 8,192 UTF-16 code units, with tighter limits where stated.
  • JSON text inputs must parse within bounded nesting and size limits. Numeric outputs outside the safe finite range are rejected; large exact integer results use decimal strings. Indexes and half-open spans are zero-based unless a rank is explicitly described as one-based.

Alternative or Complementary methods

Use a code-point or grapheme-aware text method when the task concerns user-perceived characters. These bounded literal operations retain case and code-unit structure rather than normalizing linguistic text.

References

  1. Tool behavior and example: Cyclic String Reflection Equivalence — tool.io

Similar or alternative tools

  • Cyclic String Equivalence Check

    Check exact cyclic UTF-16 string equivalence without normalization; empty strings are equivalent to each other.

  • String Cyclic Rotation Offsets

    Return all cyclic left-rotation offsets mapping one UTF-16 string to another; all tied witnesses are retained, including periodic strings.

Don't forget to set a bookmark for tool.io!
Privacy | Imprint | Cookies