Skip to content

Main content

List Run Boundary Two Neighbor Mask Tool

Compute list run boundary two neighbor mask from explicit bounded inputs.

Loading tool…

Description

Mark start when previous differs from current and end when current differs from next.

A run is a consecutive group of equal values. Its internal adjacencies and boundary relationships differ from counts of distinct values across a whole list.

Mark start when previous differs from current and end when current differs from next.

When to use this tool

Use List Run Boundary Two Neighbor Mask when you need one run boundary or adjacency calculation.

How to use the tool and how it works

  1. Enter previous, current, next. 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 start, end, singleton. Inspect start, end, singleton before interpreting the associated values.

Mark start when previous differs from current and end when current differs from next. Mark singleton when both comparisons differ.1

Input fieldMeaning and unitsAccepted input
previousPreviousRequired. Text; maximum UTF-16 length 8192.
currentCurrentRequired. Text; maximum UTF-16 length 8192.
nextNextRequired. Text; maximum UTF-16 length 8192.
Output fieldInterpretationReturned shape
startStartRequired. Boolean.
endEndRequired. Boolean.
singletonSingletonRequired. Boolean.
json
{
  "input": {
    "previous": "a",
    "current": "b",
    "next": "c"
  },
  "output": {
    "start": true,
    "end": true,
    "singleton": true
  }
}

Limitations and assumptions

  • All neighbors are explicit values; list endpoints and missing-neighbor conventions must be resolved externally.
  • 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.

Alternative or Complementary methods

Use a complete run-length scan when maximal runs and their values need to be constructed or verified.

References

  1. Calculation and input contract: list/list-run-boundary-two-neighbor-mask — tool.io

Similar or alternative tools