Pages in topic:   [1 2] >
QA Checker 3.0 & tags
Thread poster: Lenart

Lenart  Identity Verified
Luxembourg
Local time: 15:51
Mar 7

Hello,

Does anybody know if it is possible to include tags in regex and how would you do that?

thank you


 

Anthony Rudd

Local time: 15:51
Regexes in QA Mar 7

This is an extract from a book I am preparing, unfortunately formatting and figures are lost

20.4 Use of regexes in QA
Although Trados Studio provides powerful integrated QA processing, there are many situations where regexes can be used to define user-specific QA rules. This section provides several examples of user-written QA regexes.

“Project Settings” → “Verification” → “QA Checker 3.0” → “Regular Expressions” lists the regexes performed for the QA (Quality Assurance).


Activate the “Search regular expressions” checkbox to allow edit capability (otherwise the input fields are blocked).
Condition
The “Condition” specifies which regex verification should be performed.

Condition Meaning
Report if both target and source RegEx patterns match The patterns found in the source and the target match, i.e. no transformation performed
Report if target matches but not the source The pattern found in the target does not have the specified matching pattern in the source
Report if source matches but not the target The pattern found in the source does not have the specified matching pattern in the target
Report if source matches (source check only) The specified source pattern is found
this can be used pattern searching in the source
Report if target matches (target check only) The specified target pattern is found
this can be used pattern searching in the source
Report if both source and target match but with different count The number of patterns found in the source and target differ
Grouped search expression - report if source matches but not target The capturing group specified in the source is not found in the target
Grouped search expression - report if source and target matches The capturing group specified in the source matches that in the source, i.e. no translation performed
Table 20-4: Regex verification conditions
“Grouped” means capturing groups are involved. In this case, the source has the regex format for matching and the target has the regex format for substitutions. The capturing groups (either numbered or named) from the source can be referenced in the target, see Example 2. The sequence of the capturing groups can be changed, for example, to check that an European format date (dd.mm.yy) has been converted correctly to an American format date (yy-mm-dd) and the individual fields match.
Example 1
Check for format mismatch.


Figure 20-4.3: QA regex entry example 1
Enter a “Description” (mandatory).
Enter the appropriate regex(es) in the “RexEx source” and/or “RexEx target” fields as appropriate.
Select an appropriate “Condition”.

This regex example checks that a source date (German, in the form dd.mm.yy) has the correct target date format (English, dd-mm-yy).

Enter (\d+)\.(\d+)\.(\d+) and (\d+)-(\d+)-(\d+) in the “RexEx source” and “RexEx target” fields, respectively.

Select “Report if source matches but not the target” as “Condition”, in this case.
Note: The converse condition (“Report if target matches but not the source”) checks that for the specified target format, the associated source format matches. In the above case, a target format date dd-mm-yy must have a corresponding source format date dd.mm.yy.

If required, activate the “Ignore case” checkbox if case-insensitive matching is to be performed.

Click “Add item” as “Action” to enter the regex rule.

Figure 20-4.4: Erroneous regex
If the regex is erroneous, its font colour changes to red (see above figure). Clicking the (red exclamation mark) icon displays the associated error message.

Click “OK” to save all the regex rules with the project.


 

Lenart  Identity Verified
Luxembourg
Local time: 15:51
TOPIC STARTER
tag <fn.*> Mar 8

Maybe an example would help. So I have this footnote tag: which is always preceded by a number.

I would like to make sure that between a number and this tag there is no space.

I have tried this:
RegEx source: \d
RegEx target: \d

but it does not work. Does anybody know where is the problem?

Thank you


 

Anthony Rudd

Local time: 15:51
regex Mar 8

Two things need to be answered here.
1. Code the regex
2. Include this regex in Trados (QA Checker).

Judging by your question, you do not really want to check that there is no space between the number and the tag, but rather it is easier to match items where there IS A space between the number and the tag -> these are the errors you want flagged.
This can be achieved with the regex: \d+ x (or more clearly \d+\x20x, \x20 = space) where x is the "tag" (special coding is required when "tag" contains metacharacters.
Note: The shown regex is very simple and will match this pattern anywhere, bounds may need to be added), but this not the place to handle the intricies of regex.

I would suggest that you test your regex with a dedicated regex test tool before you integrate it in Trados. There are several freeware test tools available in the Internet.

The exact form of the regex depends on what test is being performed, see Condition in my previous answer (for example, whether you check for a positive or a negative result).
Tip: If you just want to scan a document to check that the above mentioned situation does not occur, it is easier to invoke the regex in the Find. The regexes in the QA Checker are more appropriate when a series of regexes are to be invoked for checking.


 

Lenart  Identity Verified
Luxembourg
Local time: 15:51
TOPIC STARTER
My footnote tag is <fn id="1"/> and so I tried this: RegEx source: /d <fn.*>; RegEx target: /d<fn.*> Mar 10

Thank you for your reply!

If I write a tag in this window it becomes invisible. So I wrote it above as the title of my reply.

To the command from the title I added a Condition: Report if source matches but not the target.

Unfortunately it does not work. Any idea where might be a problem?

[Edited at 2018-03-10 16:08 GMT]

[Edited at 2018-03-10 16:09 GMT]

[Edited at 2018-03-10 16:09 GMT]

[Edited at 2018-03-10 16:11 GMT]

[Edited at 2018-03-10 16:15 GMT]

[Edited at 2018-03-10 16:17 GMT]

[Edited at 2018-03-10 16:18 GMT]

[Edited at 2018-03-10 16:18 GMT]


 

Anthony Rudd

Local time: 15:51
QA validation regex Mar 10

The regex metacharacter for a digit is \d not /d.

I am not sure what you are trying to validate. It is not clear where there should be no space between that tag and the number.
Could you please supply two examples, one valid and one invalid.

If is invalid,
this could be matched with the
regex:


 

Lenart  Identity Verified
Luxembourg
Local time: 15:51
TOPIC STARTER
My footnote tag is <fn id="1"/> and so I tried this: RegEx source: \d <fn.*>; RegEx target: \d<fn.*> Mar 11

ok so the situation that usually occurs in my translations is this (date is changing):

source segment: 14 mars 2018 fn

(fn being foot note TAG)

in target segment I get this translation by default: z dne 14. marca 2018 fn

(this translation is wrong because of the last space before the foot note, correct translation being z dne 14. marca 2018fn)

so I would like to get an error notice if there is a space before fn in target

But it seems to me that QA is not recognizing tags at all.


 

Anthony Rudd

Local time: 15:51
QA regexes Mar 11

I understand you problem now. It is true that Find/Replace and QA Checker do not support regexes in conjunction with tags.
Ther eare two possible solutions for your problem.
1. If it suffices to check that a space does not incorrectly follow a data - this you can test with a QA regex
2. Otherwise install the Integrated Search Views addin that provides some support for tags and regexes


 

Lenart  Identity Verified
Luxembourg
Local time: 15:51
TOPIC STARTER
reply Mar 11

1. unfortunately it doesn't and 2. where I work addins are not allowed and are blocked.

I guess I'll have to check spaces before tags manually.

thank you for your help!


 

mark8  Identity Verified
Czech Republic
Local time: 15:51
Member
English to Polish
+ ...
Please use Regex not "normal" expressions Mar 11

You have to use RegeX (NET flavour) not normal expressions.
eg. Your tag in Regex is \u003Cfn\sid\u003D\u00221\u0022\u002F\u003E
Pls try.


 

Lenart  Identity Verified
Luxembourg
Local time: 15:51
TOPIC STARTER
My footnote tag is <fn id="1"/> Mar 12

I tried but it doesn't work. Might be that TAG is not correct.

If I write an exact TAG of my footnote in this window, it becomes invisible. So I wrote it above as the title of my reply.

Can you please tell me the net flavor expression for this exact TAG.


 

mark8  Identity Verified
Czech Republic
Local time: 15:51
Member
English to Polish
+ ...
reply Mar 12

Sorry, I am not a frequent user of QA Checker 3.0.
I was sure that Regex tab of QA Checker supported tag search.
I use SDL Studio 2017 and Advanced Display Filter (integrated in Studio 2017, not add-in).
Advanced Display Filter supports regex in conjunction with tags.


 
Post removed: This post was hidden by a moderator or staff member because it was not in line with site rule

Anthony Rudd

Local time: 15:51
ADF regex Mar 13

Enter this regex in the Advanced Display Filter:
\d+\. \w+ \d{4} ..

This should find a space in front of the tag.

Question: Why can I not attach a file? I do not see any "Attachment" button

[Edited at 2018-03-13 06:18 GMT]

[Edited at 2018-03-13 10:25 GMT]

[Edited at 2018-03-13 10:26 GMT]


 

Lenart  Identity Verified
Luxembourg
Local time: 15:51
TOPIC STARTER
Thank you! Mar 13

I don't understand the „{4} “ part of your code, but I put it in WORD section of QA Checher and it works great. I didn't manage to get it work in Regular expressions segment but it doesn't matter.

Thank you!

(It might be that attachment option only comes with payed accounts like pasting screenshots does. Upgrading membership cost 300$ per year)

[Edited at 2018-03-13 18:49 GMT]


 
Pages in topic:   [1 2] >


To report site rules violations or get help, contact a site moderator:


You can also contact site staff by submitting a support request »

QA Checker 3.0 & tags

Advanced search







SDL Trados Studio 2017 Freelance
The leading translation software used by over 250,000 translators.

SDL Trados Studio 2017 helps translators increase translation productivity whilst ensuring quality. Combining translation memory, terminology management and machine translation in one simple and easy-to-use environment.

More info »
SDL Trados Studio 2017 only €435 / $519
Get the cheapest prices for SDL Trados Studio 2017 on ProZ.com

Join this translator’s group buy brought to you by ProZ.com and buy SDL Trados Studio 2017 Freelance for only €435 / $519 / £345 / ¥63000 You will also receive FREE access to Studio 2019 when released.

More info »



Forums
  • All of ProZ.com
  • Term search
  • Jobs
  • Forums
  • Multiple search