Skip to main content

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

MicroSkills Reference

Resolve Plural Category

localization.plural_category_resolve

ProductionEngine wrapper (Class A)Deterministicstrictinstantv1.0.0
No network

Overview

You send a BCP 47 locale, a decimal string, and CARDINAL or ORDINAL. We return ZERO, ONE, TWO, FEW, MANY or OTHER together with the visible fraction-digit counts that CLDR uses, so 1 and 1.0 can differ. Exponent notation is refused. We do not format the number or compile custom plural rules. A successful call costs 1 execution credit.

CLDR plural operands distinguish 1 from 1.0. A model cannot prove the category from the locale tag and the decimal string alone.

Reliability

Same locale, same decimal string, same type, same ICU/CLDR versions, same answer. LOCALE_INVALID — trigger: the locale is POSIX or ill-formed; retryable: no; next: send a hyphenated BCP 47 tag. NUMBER_FORMAT_INVALID — trigger: exponent notation, empty, or a non-decimal string; retryable: no; next: send 1 or 1.0, not 1e0.

Context footprint

One locale and one number in. A successful call costs 1 execution credit.

When to use it

When you hold a locale and a decimal string and need the CLDR plural bucket.

When you want the formatted phrase, or a locale picked from Accept-Language.

Powered by ICU4J CLDR plural rules (com.ibm.icu:icu4j).

Scope

Note
Returns the CLDR cardinal or ordinal plural category for one locale and one decimal string.

Non-goals

  • Does not format the number or the message
  • Does not resolve plural ranges
  • Does not compile caller-supplied plural rules

Properties

IdempotentRetry safeStreaming supportedFile input supportedRequires external service

Capabilities

analysis

Cost & billing

Flat rate per invocation

MetercallsBillable onsuccessCost per call1 credit

File handling

Accepts file_refProduces file_refMax input1 KB

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
localestringYesBCP 47 language tag whose CLDR plural rules are used.
numberstringYesDecimal operand as written, without exponent notation.
typestringNoCARDINAL or ORDINAL; omit it for CARDINAL.

Output schema

FieldTypeRequiredDescription
categorystringYesResolved plural category.
canonicalTagstringYesCanonical BCP 47 tag for the supplied locale.
typestringYesApplied plural type.
integerDigitsintegerYesVisible integer-digit count.
visibleFractionDigitsintegerYesCLDR operand v: how many fraction digits were written, so 1.0 has 1.
fractionDigitsWithoutTrailingZerosintegerYesCLDR operand t: visible fraction digits after dropping trailing zeros.
_metaobjectYesClosed ICU and CLDR versions used for this answer, with icuVersion and cldrVersion strings.

API contract

POST /v1/execute
curl
curl -sS -X POST "$BASE/v1/execute" -H "Authorization: Bearer $KEY" -H 'Content-Type: application/json' -d '{"skillKey":"localization.plural_category_resolve","input":{"locale":"en","number":"1"}}'
Integrations
TypeScript SDK
import { Squillify } from "@squillify/sdk";

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

const { output } = await sq.execute("localization.plural_category_resolve", {"locale":"en","number":"1"});

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.
LOCALE_INVALID400NoThe request payload failed this skill's input validation.
NUMBER_FORMAT_INVALID400NoThe request payload failed this skill's input validation.

Other limits

LimitValue
Recommended inline bytes32 KiB

Limitations

  • Does not format the number or the message
  • Does not resolve plural ranges
  • Does not compile caller-supplied plural rules
  • Rendering '1 file' yourself from a template
  • Inventing extra plural buckets

How to call

POST /v1/execute (requires authentication)

Request bodyjson
{
  "skillKey": "localization.plural_category_resolve",
  "input": {
    "locale": "en",
    "number": "1"
  }
}

Examples

English one versus 1.0

Inputjson
{
  "locale": "en",
  "number": "1"
}
Expected outputjson
{
  "canonicalTag": "en",
  "_meta": {
    "icuVersion": "76.1",
    "cldrVersion": "46.0"
  },
  "type": "CARDINAL",
  "category": "ONE",
  "integerDigits": 1,
  "fractionDigitsWithoutTrailingZeros": 0,
  "visibleFractionDigits": 0
}
Tip
English cardinal 1 is ONE

English ordinal two

Inputjson
{
  "number": "2",
  "type": "ORDINAL",
  "locale": "en"
}
Expected outputjson
{
  "canonicalTag": "en",
  "_meta": {
    "icuVersion": "76.1",
    "cldrVersion": "46.0"
  },
  "type": "ORDINAL",
  "category": "TWO",
  "integerDigits": 1,
  "fractionDigitsWithoutTrailingZeros": 0,
  "visibleFractionDigits": 0
}
Tip
English ordinal 2 is TWO
  • Choosing the Arabic plural bucket for 0, 1, 2 and 3
  • Picking an English ordinal suffix category for 1, 2, 3 and 4

Avoid for

  • Rendering '1 file' yourself from a template
  • Inventing extra plural buckets

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

analysisplurali18ncldr