Skip to main content

Squillify development is paused indefinitely. Read why, and discover what this experiment achieved. Read the story

MicroSkills Reference

Sentence Counter

text.count_sentences

ProductionBounded custom (Class B)Deterministicverifiableinstantv1.0.0
File inputNo network

Overview

You pass text (or a file_ref); we count its sentences under a policy you pick — Unicode break rules for real prose, or a plain split on . ! ? and … when you want something blunt and predictable — and hand back the sentences themselves on request. The blunt policy always ships a warning, because abbreviations and decimals fool it.

Sentence boundaries are linguistically complex. We give you two explicit policies with transparent accuracy trade-offs instead of opaque guessing.

Reliability

VERIFIABLE and deterministic for a given policy, locale, and text on this runtime. Unicode counts may shift after a JDK Unicode upgrade. simple_punctuation emits a reliability warning. Input validation (not retryable): invalid policy; missing text and file_ref.

Context footprint

One call gives you auditable sentence counts without LLM estimation. Accepts inline text up to 1,000,000 chars or file_ref (up to 2 MB). Upload files via POST /v1/files/upload before passing file_ref. A successful call costs 1 execution credit.

When to use it

When you need sentence counts for readability, analytics, or downstream text metrics and want the segmentation policy documented.

Do not use when you need precision NLP segmentation for complex or abbreviation-heavy text — prefer unicode_sentence_boundary or dedicated NLP tools.

Scope

Note
Counts sentences in your text using Unicode break rules or simple punctuation, with locale awareness and explicit policy selection.

Non-goals

  • Does not perform NLP sentence parsing
  • Does not guarantee accuracy on abbreviation-heavy text under simple_punctuation

Properties

IdempotentRetry safeStreaming supportedFile input supportedRequires external service

Capabilities

analysistext-processing

Cost & billing

Flat rate per invocation

MetercallsBillable onsuccessCost per call1 credit

File handling

Accepts file_refProduces file_refMax input976.6 KBMax file size1.9 MB

File limits

Constraints this skill applies to your input and generated files. The “Limited by” column shows the static source of each cap; none of these can be raised by upgrading your plan.

LimitValueLimited by
Maximum size per input file1.9 MiBSkill maximum

How we handle your data

Sensitive input, safe output
What this means

This skill may receive sensitive content, but it does not target sensitive data and returns only a structured non-sensitive result.

Squillify guarantees
  • Runs inside Squillify
  • This skill runs inside Squillify.
  • Payloads are not sent to an external service by this skill.
  • Squillify does not permanently store submitted payloads.
  • Telemetry records metadata only, not submitted content.
  • Submitted payloads are not used for training.
  • Submitted payloads are not reviewed by humans.
  • This skill does not target sensitive data.
  • The response does not contain submitted content.
Your responsibility

Squillify does not determine whether submitted content is sensitive. Your application is responsible for deciding what data it is allowed to submit. Your application is responsible for securing the response.

Read the Microskill Data Handling Policy

Input schema

FieldTypeRequiredDescription
textstringNoBounded inline text source. Required unless file_ref is provided.
file_refstringNoTenant-scoped opaque text-file reference. Omit it to use the required inline text; never send both.
localestringNoBCP 47 segmentation locale; omit it for und.
policystringNoSentence policy; omit it for unicode_sentence_boundary.
return_segmentsbooleanNoWhether sentence text is returned; omit it for false.

Output schema

FieldTypeRequiredDescription
skillstringYesProducing skill key.
countintegerYesCounted sentences. This non-negative total is bounded by the documented input limit.
unitstringYesMeasurement unit for the returned sentence total.
policystringYesApplied sentence policy.
localestringYesApplied BCP 47 locale.
segmentsarrayNoReturned sentences in reading order. The item shape is one bounded string and the array contains from 0 through 1000000 items.
warningsarrayYesBounded warning array containing from 0 through 4 items, where each item is one non-fatal advisory string.

API contract

POST /v1/execute
curl
curl -sS -X POST "$BASE/v1/execute" -H "Authorization: Bearer $KEY" -H 'Content-Type: application/json' -d '{"skillKey":"text.count_sentences","input":{"text":"Hello. World!","policy":"unicode_sentence_boundary"}}'
Integrations
TypeScript SDK
import { Squillify } from "@squillify/sdk";

const sq = new Squillify({ apiKey: process.env.SQUILLIFY_API_KEY });

const { output } = await sq.execute("text.count_sentences", {"policy":"unicode_sentence_boundary","text":"Hello. World!"});

Errors

CodeHTTPRetryableDescription
VALIDATION_ERROR400NoThe request payload failed schema validation.
UNAUTHORIZED401NoMissing or invalid API key.
SKILL_NOT_ACCESSIBLE403NoThe API key is not granted access to this skill.
SKILL_NOT_AVAILABLE_FOR_PLAN403NoThis skill is not included in your current plan.
PLAN_ELIGIBILITY_UNAVAILABLE503YesPlan eligibility could not be decided. Retry after backoff.
SKILL_NOT_FOUND404NoThe requested skill or version does not exist.
TENANT_RATE_LIMITED429YesRequest rate limit exceeded. Retry after backoff.
QUOTA_EXCEEDED429YesPlan quota exhausted. Retryable once the quota period resets.
EXECUTION_TIMEOUT504YesExecution exceeded the allowed time budget.

Other limits

LimitValue
Recommended inline bytes32 KiB

Limitations

  • Does not perform NLP sentence parsing
  • Does not guarantee accuracy on abbreviation-heavy text under simple_punctuation
  • Precise NLP sentence segmentation for legal or clinical text
  • Abbreviation-heavy prose when using simple_punctuation without review

How to call

POST /v1/execute (requires authentication)

Request bodyjson
{
  "skillKey": "text.count_sentences",
  "input": {
    "policy": "unicode_sentence_boundary",
    "text": "Hello. World!"
  }
}

Examples

Unicode sentence boundary

Inputjson
{
  "policy": "unicode_sentence_boundary",
  "text": "Hello. World!"
}
Expected outputjson
{
  "count": 2,
  "skill": "text.count_sentences",
  "policy": "unicode_sentence_boundary",
  "locale": "und",
  "warnings": [],
  "unit": "sentence"
}

Simple punctuation with abbreviation caveat

Inputjson
{
  "policy": "simple_punctuation",
  "text": "Dr. Smith went home. He was tired."
}
Expected outputjson
{
  "count": 3,
  "skill": "text.count_sentences",
  "policy": "simple_punctuation",
  "locale": "und",
  "warnings": [
    "simple_punctuation is not linguistically reliable and may miscount abbreviations, decimals, initials, and ellipses."
  ],
  "unit": "sentence"
}
  • Feed readability or speaking-time pipelines with sentence counts
  • Measure content structure for articles, reports, or transcripts
  • Compare sentence density across documents with a documented policy

Avoid for

  • Precise NLP sentence segmentation for legal or clinical text
  • Abbreviation-heavy prose when using simple_punctuation without review

Composable with

Safety & privacy

  • Runs without calling any external service.
  • Your payloads are never stored permanently.
  • Telemetry captures metadata only — never your payload contents.
  • We never train models on your payloads.
  • No human reviews your payloads.

Tags

textanalysisstatistics