Skip to content
HALOWERK

Text Tools

icu expand selection to words

Word selection expands a nonempty UTF-16 selection to the complete words it intersects. Use it when an agent needs a whole-word selection for localized highlighting.

POST https://text.halowerk.com/v1/icu-expand-selection-to-words

Inputs

Fields of the published input schema
FieldTypeRequiredDescription
textstringYes
localestringNo
startintegerYes
endintegerYes
Show full input schema
{
  "type": "object",
  "properties": {
    "text": {
      "type": "string",
      "maxLength": 7000,
      "minLength": 1
    },
    "locale": {
      "type": "string",
      "maxLength": 45,
      "minLength": 1
    },
    "start": {
      "type": "integer",
      "minimum": 0,
      "maximum": 7000
    },
    "end": {
      "type": "integer",
      "minimum": 1,
      "maximum": 7000
    }
  },
  "required": [
    "text",
    "start",
    "end"
  ],
  "additionalProperties": false
}

Open original schema

Published input example

{
  "text": "Operating systems. Library management system.",
  "locale": "en",
  "start": 2,
  "end": 11
}

Result & documentation

Show published result schema
{
  "type": "object",
  "required": [
    "measured_at",
    "source",
    "data",
    "limitations"
  ],
  "properties": {
    "measured_at": {
      "type": "string"
    },
    "source": {
      "type": "object",
      "required": [
        "reference",
        "retrieved_at"
      ],
      "properties": {
        "reference": {
          "type": "string"
        },
        "retrieved_at": {
          "type": "string"
        }
      }
    },
    "data": {
      "type": "object",
      "properties": {
        "matched": {
          "type": "boolean"
        },
        "start": {
          "type": "integer"
        },
        "end": {
          "type": "integer"
        },
        "selection": {
          "type": "string"
        }
      },
      "required": [
        "matched",
        "start",
        "end",
        "selection"
      ]
    },
    "limitations": {
      "type": "string"
    }
  }
}

Machine-readable documentation of this hub

Source of this page: the published HALOWERK catalog. Updated: 2026-11-20 UTC.

More endpoints in this hub

All endpoints in this hub →