Pages

Jul 12, 2012

RegEx for translating DVX external view tables in memoQ

Atril's Dejà Vu was the first translation environment tool I am aware of to offer a means of exchanging translation content for review, correction and translation using an ordinary word processor. These "external views" were the original inspiration for memoQ's RTF bilingual tables, which are used in many interoperable workflows not only with people using a word processor but with many other CAT tools as well.

As with memoQ RTF bilinguals, the content in the "external view" which is not to be translated can be selected and hidden with a word processor, leaving only a target column into which the source text has been copied. But these steps alone with the standard RTF filter pose a problem:


The DVX "codes" (tags), which are represented by curly brackets enclosing a number, are not protected. Erasing parts of them can damage the content. It is also not possible to perform a tag check using the memoQ QA functions.

The solution is to use the Regex tagger in memoQ. There are two ways to do this.

If the document has already been imported,


the tagger can be run from the Format menu.

Enter the appropriate regular expression to convert the DVX code to a protected tag: \{(\d+)\}


This expression describes the pattern of the text to protect: a curly bracket (with a backslash in front of it to indicate that this is to be interpreted literally as a character, not as a bracket for grouping something), one or more digits (\d indicates a digit as opposed to d, which is just the letter d, and the plus sign means one or more) and a closing curly bracket ("escaped" with a backslash so it is understood literally as the bracket character in the DVX code.)

Click Add to put the rule in the list, then click Run tagger now.


The result is protected tags in the translation grid of memoQ. These can also be verified with a QA tag check after the translation is completed.

Your regular expression rules can be saved in the dialog above and re-used, or exported from the list under Tools > Resource console... > Filter configurations and shared with others.

The regular expression tagger can also be used as a cascading filter when the RTF file for the external view is imported:



Here the configuration can also be saved or another one loaded.

4 comments:

  1. great!
    I hope it works with memoQ 2013 R2 as well, as I need it just now
    J

    ReplyDelete
    Replies
    1. Oh, yes. It works just the same still, no change at all.

      Delete
  2. Hi Kevin

    I tried to send you an email but it bounched, so sorry if I put it here
    J

    did you even noticed in the last release of memoQ an odd number behavior?
    I got crazy to understand that, and only now I found a fix
    my problem was that apparently correct number translations raised a warning flag
    today I found the damn culprit
    the default setting under "Edit QA settings/Number formats for languages" is English!!!
    But it's a nonsense as my OS is Italian, don't you think so?
    If it's not a problem for me only, I think memoQ developers should be informed that this language MUST match with the OS language
    otherwise, they should inform users that they MUST add a custom rule

    ReplyDelete
  3. I never, ever use number QA in memoQ. It causes nothing but grief in many of my documents. If you have appropriate rulesets, it is much better to use autotranslatables for the QA. This way date transformations and other change will never be marked as errors (with the right rule set).

    ReplyDelete

Notice to spammers: your locations are being traced and fed to the recreational target list for my new line of chemical weapon drones :-)