Skip to main content

All about Segmentation Rules

How wxrks segments text into translatable units, and how to upload custom .SRX rule files per source language and file type at the Account or Organizational Unit level.

All about Segmentation Rules

wxrks splits every uploaded document into segments, usually one sentence each, before translation. Segmentation drives Translation Memory matching, word counts, and how content appears in the Editor. This article explains the default segmentation behavior, what an SRX rule file is, and how to upload one for a specific source language and, optionally, specific file types, at the Account or Organizational Unit level.

Who can do this

  • Account level: Requires the Account Admin role. The Segmentation page under Settings > Translation Settings is only shown to Account Admins.

  • Organizational Unit level: Anyone who can open an Organizational Unit sees its Segmentation tab. Adding, editing, activating, or deleting rule files there requires the Organizational Unit Update permission, which Account Admins see in People > Users > [User] > Permissions. Account Admins can always manage it; any other user needs that permission granted.

An Organizational Unit is the workspace that groups a client's projects, users, and settings. See All about Organizational Units.

What is segmentation, and why would you change it?

Segmentation happens automatically when a file is uploaded. A set of rules decides where one segment ends and the next begins.

The built-in rules handle most content correctly. You'd only need custom rules when your content has a pattern the defaults don't expect. For example, a product name that ends in a period gets mistaken for the end of a sentence, or an industry abbreviation isn't in the default list. A rule set built for one format can also misbehave on another: rules tuned for DITA topics can produce parsing errors when they're applied to IDML or XLIFF files. That's why you can now limit a rule file to specific file types.

Custom segmentation is a specialized, technical adjustment. Most accounts never need it.

Default segmentation rules

wxrks ships with a built-in rule set for each source language, so standard use needs no setup. You can't view or edit these defaults in the UI. To change how a language is segmented, upload a custom SRX file as described below, or contact [email protected] for guidance.

For English (United States) source content, the defaults include rules such as:

  • Break on paragraph separators, line breaks, and sentence-ending punctuation (periods, question marks, exclamation points).

  • Break on the CJK full-width period ("。") and other full-width punctuation used in East Asian languages.

  • Don't break after common abbreviations (Mr., Mrs., Dr., Prof.) or month abbreviations (Jan., Feb., Sept.), so "Dr. Smith" and "Sept. 5, 2023" stay in one segment.

  • Don't break on a decimal point inside a number, so values like 2.55 stay intact.

Each source language has its own defaults, tuned to that language's punctuation and abbreviations.

What is an SRX file?

SRX (Segmentation Rules eXchange) is an XML-based industry standard for sentence-segmentation rules. wxrks reads standard SRX 2.0 files, so a rule file exported from another CAT (computer-assisted translation) tool will generally work in wxrks, and the other way around.

Each rule in an SRX file has a regular-expression pattern in two parts: a beforebreak part (what must appear just before a potential break) and an afterbreak part (what must appear just after it). The break attribute says whether the rule creates a break there or prevents one. This minimal rule stops wxrks from splitting after "Acme Corp.":

<srx xmlns="http://www.lisa.org/srx20" version="2.0">
  <body>
    <languagerules>
      <languagerule languagerulename="default">
        <rule break="no">
          <beforebreak>\QAcme Corp.\E</beforebreak>
          <afterbreak>\s</afterbreak>
        </rule>
      </languagerule>
    </languagerules>
  </body>
</srx>

You don't need to write SRX by hand. Most teams export a rule set from another CAT tool, build one in an SRX editor, or ask wxrks support for help with a specific case. wxrks only accepts files with the .srx extension.

How each rule file is scoped

Every rule file you upload has three settings that decide when it's used:

Setting

What it controls

Source Language

The project source language the file applies to. A file only affects projects whose source language matches.

File Types

Either All file types, or a list of specific extensions such as dita, idml, or xliff.

Active

Only active files are used. Inactive files are kept but ignored.

A file scoped to specific file types takes priority over an All file types file for those types only. Every other file type keeps using the All file types file.

ℹ️ Note: Rule files uploaded before file-type scoping was available show All file types and keep working exactly as they did.

Upload a rule file at the Account level

An Account-level rule file applies to every Organizational Unit in the Account that doesn't have its own matching rule file (see Which rule file applies to a file).

The Segmentation page lists every Account rule file in the Segmentation Rules table, with its File, Language, File Types, and Active status.

Segmentation page under Settings &gt; Translation Settings, with a red box around the File Types column of the Segmentation Rules table. Most rules show the All file types badge; one rule shows DITA and DITAMAP badges.

  1. Go to Settings > Translation Settings > Segmentation.

  2. Click Add new segmentation file.

  3. Click Select a segmentation file and choose your .srx file.

  4. Under Source Language, select the language the file applies to.

  5. Under File Types, choose which files the rule set covers. Leave Apply to all file types on to use it for every format. To limit it, turn Apply to all file types off and pick one or more extensions in Select file types. You must pick at least one extension before you can save.

  6. Turn on Set as active if the file should take effect right away.

  7. Click Save.

Add new segmentation file modal with dita-rules.srx selected and English (United States) as the Source Language. A red box marked 5 surrounds the File Types field, showing dita and ditamap selected, and the Apply to all file types switch turned off.

ℹ️ Note: When Set as active is on, the Select file types list hides extensions already covered by another active file for the same language. Apply to all file types is also unavailable if another active All file types file exists for that language. This keeps two active files from claiming the same file type.

Upload a rule file for an Organizational Unit

Use an Organizational Unit-level file when one client's content needs different segmentation from the rest of the Account, or when that client needs a different default rule set.

  1. Go to Organizations > Organizational Units and open the Organizational Unit.

  2. Click the Segmentation tab.

  3. Click Add new segmentation file and fill in the form exactly as at the Account level: the .srx file, Source Language, File Types, and Set as active.

  4. Click Save.

Organizational Unit page with red boxes on the Segmentation tab (marked 2) and the Add new segmentation file button (marked 3). The table reads No segmentation rules found, even though the Account has its own rule files.

ℹ️ Note: The Organizational Unit's Segmentation tab lists only that Organizational Unit's own rule files. Account-level files aren't shown there, but they still apply to any file type the Organizational Unit doesn't cover. Check Settings > Translation Settings > Segmentation to see what the Organizational Unit inherits.

Change the file types of an existing rule file

  1. On the Account Segmentation page or an Organizational Unit's Segmentation tab, click the badge in the rule's File Types column (All file types or the list of extensions).

  2. In Edit file types, turn Apply to all file types on, or turn it off and choose the extensions in Select file types.

  3. Click Save. wxrks confirms with File types updated.

Edit file types modal with a red box marked 2 around the File Types field, showing dita and ditamap selected, and a second red box around the Apply to all file types switch, turned off.

The new scope applies to files uploaded from then on.

Activate or deactivate a rule file

Use the Active switch on the rule's row. Turning a file off keeps it in the list so you can turn it back on later.

Within one level (the Account, or one Organizational Unit), each source language can have:

  • At most one active All file types file.

  • At most one active file per specific file type.

If activating a file would break these limits, its Active switch is disabled. Hover over it to see: Another active rule already covers this language and file type. Deactivate it first. Turn off the conflicting file, or change one file's File Types so they no longer overlap.

Segmentation Rules table with one active All file types rule for EN-US. A red box surrounds the disabled Active switch of another EN-US All file types rule, with the tooltip: Another active rule already covers this language and file type. Deactivate it first.

An All file types file and a file scoped to specific types never conflict. They're meant to be active together.

Which rule file applies to a file

wxrks picks one rule set for each file, based on the project's source language and the file's extension. It checks in this order and uses the first match:

  1. An active Organizational Unit file for that language whose File Types include the file's extension.

  2. An active Organizational Unit All file types file for that language.

  3. An active Account file for that language whose File Types include the file's extension.

  4. An active Account All file types file for that language.

  5. wxrks' built-in default rules for that language.

The Organizational Unit is always checked completely before the Account. An Organizational Unit All file types file therefore takes priority over an Account file scoped to a specific type.

Worked example

Your Account has one active English (United States) rule file, account-default.srx, set to All file types. One Organizational Unit translates DITA documentation, so you upload dita-rules.srx to that Organizational Unit for English (United States), scoped to dita and ditamap.

A new English (United States) project in that Organizational Unit contains user-guide.dita, brochure.idml, and strings.xliff:

File

Rule set used

Why

user-guide.dita

dita-rules.srx

The Organizational Unit has an active file that covers dita.

brochure.idml

account-default.srx

The Organizational Unit has no file for idml and no All file types file, so wxrks uses the Account's All file types file.

strings.xliff

account-default.srx

Same as above.

Before file-type scoping, dita-rules.srx would have been used for all three files, which is exactly the kind of mismatch that causes parsing errors in IDML and XLIFF files.

Now suppose you also upload ou-default.srx to the same Organizational Unit for English (United States), set to All file types. user-guide.dita still uses dita-rules.srx, but brochure.idml and strings.xliff now use ou-default.srx. The Account file is no longer used for this Organizational Unit's English (United States) projects. This is how you give an Organizational Unit a different default rule set from the Account.

Common misconfigurations

  • Picking a similar but different extension. File types match the file's exact extension. xlf and xliff are separate options, as are dita and ditamap. If your files arrive with both extensions, select both.

  • Uploading for the wrong source language. A file for English (United States) doesn't affect projects whose source language is a different English variant. Match the language exactly as it's set on the project.

  • Expecting an Organizational Unit file to fill gaps from the Account. An Organizational Unit All file types file overrides every Account file for that language, including Account files scoped to specific types. If you want the Account's type-specific files to keep applying, scope the Organizational Unit file to specific types instead.

Remove a rule file

Click the trash icon on the rule's row, then confirm. The file is deleted permanently. Files of the affected language and types then fall back to the next rule set in the order above.

⚠️ Warning: Deleting can't be undone. To stop using a file temporarily, turn off its Active switch instead.

Download a rule file

Click the file name in the File column to download a copy of the uploaded .srx file. This is useful to check which rules a file contains before you replace or delete it.

Troubleshooting

My upload was rejected. wxrks only accepts files with the .srx extension. Make sure you're uploading the SRX rule file, not the document you want segmented differently.

I can't turn on the Active switch. Another active file at the same level already covers that language and file type. Hover over the switch to confirm, then turn off the other file or change the File Types of one of them.

I see "Warning! Multiple active items were found for the same language and file type." Two active files at this level overlap, which can happen with files set up before the current limits existed. Only one of them will be used. Turn off one of the files, or change their File Types so they don't overlap.

My custom rules don't seem to apply. Segmentation runs when a file is uploaded. Files segmented before you changed the rules aren't re-split, so upload the file again to apply the new rules. Then check, in this order: the project's source language matches the rule file's Source Language exactly; the file's extension is listed in File Types (or the file is set to All file types); the rule file is Active; and no Organizational Unit file is taking priority over the Account file you expect (see Which rule file applies to a file).

  • All about Organizational Units: the full settings reference for an Organizational Unit, including how Organizational Unit settings override Account settings.

Did this answer your question?