Custom Segmentation
Each time you upload XML, HTML, MD, or any other source files without a key-value structure, the predefined segmentation rules (SRX 2.0) are used for automatic content segmentation. Although, there might be situations when the default segmentation rules segment source files in contrast to the desired expectations.
In this case, you can define your own segmentation rules for each source file individually using the SRX 2.0 standard.
Change Segmentation
You can change segmentation in Sources > Files.
- Open the project where you’d like to adjust the segmentation rules and go to Sources > Files.
- Click (or right-click) on the needed file and select Settings.
- In the appeared dialog, switch to the Parser configuration tab.
- Select Enable content segmentation and Use custom segmentation rules.
- Paste your SRX segmentation rules and click Save.
After you save your new segmentation rules, your source file will be automatically reimported and segmented according to these new rules.
Segmentation Examples
A typical SRX file looks similar to the following:
Change Sentence Separator for Asian Languages
Usually, the full stop is used as a sentence separator. Although, for some Asian languages, it’s not the case. For example, the typical sentence separator in Chinese is an ideographic full stop (。
). For such cases, you may want to use the following ruleset:
Break Text into Smaller Parts
In the following simple sentence, we’ll break down a case when segmenting one text piece into two (or more) strings is necessary.
Text with default segmentation rules:
This is the first part of the sample sentence and this is the second part.
Text with new segmentation rules:
This is the first part of the sample sentence
and this is the second part.
For this particular case, the following ruleset will break the initial sentence into two parts:
Create Segmentation Rules with SRX Editors
The SRX segmentation rules can be created and maintained with the help of tools like Ratel. It has a visual interface where you can generate segmentation rules from scratch or edit your existing ones.