Showing posts with label verification. Show all posts
Showing posts with label verification. Show all posts

Thursday, October 24, 2019

Regular Expressions for Translators: Four Applications in SDL Trados Studio

In regular expressions (regex), a new line break (or soft return) and a tab are represented with the following special characters:


In a program like SDL Trados Studio, regular expressions can be used to:

                                        1) Filter on segments that match a certain regex

                                        2) Find text that matches a regex

                                        3) Create verification settings

                                        4) Add new segmentation rules to a TM

Let's use the new line and tab special characters to look at a few examples of these applications.

1) Filtering on segments that contain a new line break

This is achieved by using the regular Display Filter (found in the Review tab), which has regex enabled by default, or the Advanced Display Filter, where regular expressions must be enabled by checking a box.

Tip: For even more powerful filtering, download the Community Advanced Display Filter from the SDL app store.

So, if we have a document that looks like this:



Entering the "new line" regex character in the Display Filter search box produces the following filtered results:



2) Finding a tab

To do this, the regular expressions checkbox in the Find dialog box must be checked. This example shows the results of the search.





Once we learn that we can use regex in the Find dialog box, a natural question is whether the same can be done in a replace operation. The answer is a bit disappointing: while the Find field accepts all kinds of regular expressions, the regex syntax accepted by the Replace field is very limited, so, in short, no, you can't do the same in the replace field, that is, you can't replace a tab character with a new line character using regex, for example. In fact, if you enter "\n" in the replace field, that will be interpreted literally as "a backslash followed by an n", and that´s exactly what will be used in the replacement.

3) Creating verification settings

SDL Trados Studio's out-of-the-box verification options include the ability to add regex patterns to flag potential errors. In the example below, a rule has been created to tell Studio that when a new line character is found in the source, it should also be present in the target.



With the rule in place, once the verification is run, the program will identify any instances where there is a new line character in the source but not in the target.




4) Adding new segmentation rules to a TM

There are some cases where creating new pattern-based segmentation rules is desirable. A new segmentation rule for line breaks (soft returns), for example, would look like this (there's a dot in the "After break" section, even though it's hard to see):



After the rule has been added to the TM, files that are added to the project will be segmented at every line break, in addition to the usual segmentation. So, for our example above, if we remove the file from the project and add it back after the rule has been added, the new segmentation would look like this:



Final words
While the examples in this article use only the tab and new line characters, all kinds of complex regex patterns can be used in the four features that make use of regular expressions in Studio (display filter, search, verification and segmentation), and while linguists don't need to be computer programmers, investing some time to learn the basics of regex will help them save time and work more efficiently.


 ¡Pregunta por los precios especiales de SDL Trados Studio para México!




Wednesday, June 17, 2015

How to easily spot unintentional spaces in Studio segments

Studio's QA Checker offers a section under Punctuation to check for unintentional spaces before punctuation marks, a very useful feature to spot those extra spaces that might be difficult to see, especially in the vicinity of tags.

I find that a simple enhancement that makes this feature more useful for me is adding a closing parenthesis and a comma to the selection of marks, which already includes a colon, an exclamation point, a question mark and a semicolon.

To apply this change to all projects created in the future and to future documents processed with the single document translation workflow, go to File - Options - Verification - QA Checker 3.0  - Punctuation and add the necessary punctuation marks as shown below:


Please note that making this change at the global level will not affect any existing projects or open documents.

To apply the change to current projects in your system created before the change or to packages received from a client, go to Project Settings - Verification - QA Checker 3.0  - Punctuation and do the same.



Once this has been set, Studio will show a warning* when unintentional spaces are found in a target segment, as shown here:



*Provided that the QA Checker 3.0 checkbox (under Verification) and the Check for intentional spaces before: checkbox (under Punctuation) are checked.

And that's it, a simple customization that can make Studio a little more helpful!