Merge and split segments in OmegaT (update)

The OmegaT script for merging and splitting segments has received a few new improvements:

  • The locale code for the “MergeSplit” rule set now matches the project’s source locale. This may not be very convenient in some cases, but it was introduced to work around a new development in OmegaT that reverts the names of the sets containing only the language code followed by .* back to their predefined names (i.e. “MergeSplit” created for “EN.*” will become “English” for “EN.*”).
  • If separateMappingRule is set to false, new rules created by the script will be added to the first set with the matching locale or language code (see this post for available options in the script and how to set them).
  • All dialogs (alerts and confirmations) are now placed in the center of the main OmegaT window. This solves a rather annoying problem in a multi-monitor setup where all new dialogs would pop up on the main screen regardless of the position of OmegaT.

The new version has been tested on OmegaT 5.7.x and 6.x. If you need help with installing and using scripts in OmegaT, see this post.

The script is available on GitHub and FS.net.

If you need more info on how to install and use OmegaT scripts, see this quick guide.

If you find this script useful, please leave a comment.

There’s also a very easy way to say thank you.
Your support makes more scripts like this possible.

Happy merging and splitting!

Merge and split segments in OmegaT (update)

The OmegaT script for merging and splitting segments has received a few improvements:

  • It can display the text to be split or merged with or without tags.
  • If tags are to be shown, they can be formatted with a different font color and size to make the actual text more readable.
  • If a split is attempted while the text cursor is inside a tag, the script won’t add a rule and will inform the user.
  • The preview of the split or merge to be performed now has horizontal borders to make it easier to see the possible result.

So, these are the options that can be configured by the user:

enforceProjectSRX   = true   //if true, the script will make sure project-specific segmentation is enabled
separateMappingRule = true   //if true, the script will add a separate group for its rules
showTags            = true   //if false, tags won't be shown in the confirmation message
paintTags           = true   //if true, tags will be shown in different font size and color
tagColor            = "gray" //tag color
tagSize             = 1      //tag size

Comments in these lines should make it pretty clear what each option does. To change an option, go to Tools → Scripting…, then select Merge or split segments in the list of scripts. In the text area on the right side of the screen, scroll down a bit (to about line 30), find the option you want to change, edit it, press Ctrl+S to save, and run the script.

The script is available on GitHub and FS.net.

If you need more info on how to install and use OmegaT scripts, see this quick guide.

If you find this script useful, please leave a comment.

There’s also a very easy way to say thank you.
Your support makes more scripts like this possible.

Happy merging and splitting!

Merge and split segments in OmegaT

This article is about performing merging and splitting segments in OmegaT using a convenient groovy script.

Continue reading

Merging and Splitting Segments in #OmegaT without editing segmentation rules.

UPDATE (December 2022): This post below might be interesting only for historical reasons, but even that is highly doubtful. The updated solution to the merge and split problem is published here. Continue reading