Skip to main content

What is SRX?

SRX (Segmentation Rules eXchange) is an XML-based industry standard for defining how source text is split into segments for translation. Phrase TMS uses SRX 2.0 as one of two formats for custom segmentation rules, alongside a simpler XLSX abbreviation-list format. Segmentation determines where segment boundaries fall (typically at sentence ends), which directly affects translation memory match quality — a job segmented differently than the TM it’s leveraged against will get lower or no matches. For the product-level walkthrough of the Segmentation settings UI, see the Segmentation Rules (TMS) support article. For the full SRX 2.0 specification, see the Okapi Framework SRX reference. This guide covers the format basics and how it plugs into the TMS API.

The two rule formats

Rules are managed per language under Project Settings → Segmentation in the TMS web UI, where default rules can be exported as a starting point, and custom rules uploaded as primary or secondary rule sets. Segmentation rules are applied at job import time.
Phrase’s SRX rules are character-based: only a single character can act as the segment separator. A group of characters (e.g. a tag like <p>) can’t be used as a separator.

SRX 2.0 structure

An SRX document has a header (global options) and a body (the rules):
  • headercascade controls whether more than one matching languagemap can apply its rules in sequence (yes) or only the first match is used (no, the SRX 1.0-compatible default). segmentsubflows controls whether text inside sub-flows (e.g. footnotes) is segmented too. formathandle controls whether inline formatting codes at the start/end/isolated position of a segment are included in it.
  • languagerules — one or more named groups of rule elements, evaluated top to bottom. Each rule is either break="yes" (this is a valid segment boundary) or break="no" (suppress a break here, even if a later rule would otherwise break). A rule matches when the text immediately before the candidate break point matches beforebreak and the text immediately after it matches afterbreak.
  • maprules — maps a language code pattern (languagemap languagepattern, a regex like .* or (DE|de).*) to one of the named languagerule groups, so different languages can use different rule sets.
The example above is the canonical default rule set: break after a period followed by whitespace, unless the period follows a run of single capital letters with periods (e.g. don’t break after “U.S.” or “U.K.”).

Example: a language-specific exception

To add a German-only exception for “Co.” (as in “GmbH & Co. KG”) not ending a sentence, add a second languagerule group and map it to German locales:
Rule order matters: the break="no" rule for “Co.” is listed before the general break="yes" rule, so it takes precedence at that position.

Working with segmentation rules via the API

The same actions are available from the TMS web UI under Project Settings → Segmentation.