Gå til hovedinnhold

kapi exec segmentation

kapi segmentation [files...]

Split source text into sentence or chunk segments (stand-off overlay)

Commandexec segmentation
Aliasessegment
Try it (demo)

Demo mode — illustrative output from a built-in stub, not a real model. Install the CLI to run with your own API key.

kapi segmentation messages.json
Flags
FlagTypeDefaultDescription
--concurrency, -jint0max parallel files (0 = auto)
--credentialstringStored credential name
--encoding, -estringUTF-8input file encoding
--enginestringsrxWhich segmenter to use; the default needs no configuration (Rule-based (hybrid SRX/UAX-29), Unicode baseline (UAX-29), LLM (semantic chunks))
--fail-on-unknownboolfalseexit with error if any file cannot be processed (default: skip with warning)
--format, -fstringoverride input format detection
--instructionstringOptional guidance for how to chunk
--jsonboolfalseoutput results as JSON
--layerstringSegmentation overlay layer name; empty uses the engine's natural layer
--map, -mstringArraymap glob pattern to format (e.g. '*.docx=okf_openxml:test')
--max-chunk-runesint0Soft upper bound on chunk size in characters (0 = model default)
--modelstringModel name
--no-warnboolfalsesuppress warnings for skipped files
--output, -ostringoutput path template (variables: {dir}, {name}, {ext}, {lang})
--output-dirstringwrite outputs under DIR/{lang}/ (default: beside the input, mirroring its locale layout)
--overwrite-segmentationboolfalseRe-segment already-segmented blocks replacing previous segmentation
--packboolfalsewhen transforming a .kpz, also eject the result to the .kpz (auto-pack)
--parallel-blocksint0fan out block processing across N goroutines (0 = off)
--progress, -pboolfalseshow progress bar
--providerstringAI provider id (anthropic
--renumber-codesboolfalseRenumber inline code IDs when materializing segments to a bilingual format
--rules-pathstringPath to a custom SRX 2.0 rules file (overrides the built-in ruleset)
--segment-sourcebooltrueSegment the source text
--segment-targetboolfalseSegment existing target text
--source-langstringensource language (e.g. en, en-US)
--strictboolfalsealias for --fail-on-unknown
--target-langstringtarget language (e.g. fr, de-DE)
--tracestringwrite flow trace JSON to file (for flow visualization)
--treat-isolated-codes-as-whitespaceboolfalseTreat isolated inline codes as whitespace during segmentation
--trim-leading-whitespacebooltrueExclude leading whitespace from each segment span
--trim-trailing-whitespacebooltrueExclude trailing whitespace from each segment span
More examples
kapi segmentation app.xliff

← Back to the Command Reference