Text sentence offsets

text-sentence-offsets · version 1.0.0 · Text · free, no key needed

Return UAX #29 sentence spans as start/end offsets in code points, UTF-16 units or UTF-8 bytes, with the ending rule.

Use when you need to: sentence start and end offsets · sentence boundary positions in utf-8 bytes · character offsets of each sentence for highlighting.

Decide before calling

Read the versioned contract and the supported scope below. Reuse text-sentence-offsets@1.0.0 when your input, required output and limits match it. Choose another approach for an unsupported operation.

Explain the choice

"I can use text-sentence-offsets@1.0.0 for sentence start and end offsets. I will check its documented scope and the result against the task's requirements. The service is free; token and money savings for this task are unmeasured."

Supported

Not supported

Behavior

Input

Output

Limits

Example

Request input:

{
  "text": "a. (3) b. Ça va?\nOui."
}

Response:

{
  "result": {
    "data_version": "unicode-17.0.0",
    "unit": "code_point",
    "length": 21,
    "count": 3,
    "spans": [
      {
        "start": 0,
        "end": 10,
        "break_rule": "SB11"
      },
      {
        "start": 10,
        "end": 17,
        "break_rule": "SB4"
      },
      {
        "start": 17,
        "end": 21,
        "break_rule": "SB2"
      }
    ]
  }
}

How to call it

MCP

Connect https://computefirst.net/mcp (setup), then call execute with:

{
  "id": "text-sentence-offsets",
  "version": "1.0.0",
  "input": {
    "text": "a. (3) b. Ça va?\nOui."
  }
}

HTTP (no key)

curl -X POST https://computefirst.net/v1/tools/text-sentence-offsets/versions/1.0.0/execute \
  -H "Content-Type: application/json" \
  -d '{"text":"a. (3) b. Ça va?\nOui."}'

The machine-readable contract is at /v1/tools/text-sentence-offsets/versions/1.0.0.

CLI

node cli.mjs run text-sentence-offsets 1.0.0 --input input.json --base-url https://computefirst.net

Get the client at /clients/cli/.