A question regarding Regex Expression
Autor de la hebra: Donglai Lou (X)
Donglai Lou (X)
Donglai Lou (X)  Identity Verified
China
Local time: 06:00
inglés al chino
+ ...
Aug 28, 2013

Dear Colleague or Developer,

I need to auto translate numbers like "1.2 million" to "120" wan in Chinese.

I wrote the following expression:

(\d{1,2})\.(\d) million and $1$20 wan

usually a third party regex editor. this combo works. however, in Memoq, the result is

1$20 wanwan

could anyone kindly advise a solution.

thank you very much for your help in advance.

best regards,


 
John Fossey
John Fossey  Identity Verified
Canadá
Local time: 18:00
Miembro 2008
francés al inglés
+ ...
Maybe a bug? Aug 28, 2013

In your target expression the regex editor sees $20 as calling the 20th term, which of course doesn't exist.

But I tried several ways to escape the digit '0' without success, including using a named reference to memoQ's Translation Pair feature. When I tried to use a Translation Pair the pair would work successfully but then the second term was still ignored and would result in '$2' as '1$20 wan' instead of the desired result.

Perhaps it's a bug in the regex processor,
... See more
In your target expression the regex editor sees $20 as calling the 20th term, which of course doesn't exist.

But I tried several ways to escape the digit '0' without success, including using a named reference to memoQ's Translation Pair feature. When I tried to use a Translation Pair the pair would work successfully but then the second term was still ignored and would result in '$2' as '1$20 wan' instead of the desired result.

Perhaps it's a bug in the regex processor, in which case memoQ support may be able to help.

[Edited at 2013-08-28 13:07 GMT]
Collapse


 
MuMyongCy (X)
MuMyongCy (X)
República de Corea (Corea del Sur)
Local time: 07:00
inglés al coreano
How about Aug 28, 2013

to use workarounds.


1,
(\d{1,2})\.(\d) million --> $1$2Ring wan

2,
Ring wan --> 0 wan


Looks silly, but works fine (I guess).


Regards


 
Donglai Lou (X)
Donglai Lou (X)  Identity Verified
China
Local time: 06:00
inglés al chino
+ ...
PERSONA QUE INICIÓ LA HEBRA
Another problem with autotranslation Aug 28, 2013

Thank you, John and Jaesang for your kind reply and smart workaround. let's see whether there are any official solution from Memoq support:).

Besides, I just encountered another problem. let me call it "embedded rules". that is, I have a long auto-rule to cover the whole sentence and some short rules to cover the segments in the sentence. However, only the long rule is prompted and all the other small rules are omitted. hopefully, I made myself clear.

Just now I notice
... See more
Thank you, John and Jaesang for your kind reply and smart workaround. let's see whether there are any official solution from Memoq support:).

Besides, I just encountered another problem. let me call it "embedded rules". that is, I have a long auto-rule to cover the whole sentence and some short rules to cover the segments in the sentence. However, only the long rule is prompted and all the other small rules are omitted. hopefully, I made myself clear.

Just now I notice some short rules display. I still need to verify whether this problem exist or not.

Yes, this is not a problem. however, when assembling fragments, not all of these rules will apply to the same segment or unit.


best regards,
Donglai



[Edited at 2013-08-28 14:19 GMT]

[Edited at 2013-08-28 14:35 GMT]
Collapse


 


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


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

A question regarding Regex Expression






Trados Studio 2022 Freelance
The leading translation software used by over 270,000 translators.

Designed with your feedback in mind, Trados Studio 2022 delivers an unrivalled, powerful desktop and cloud solution, empowering you to work in the most efficient and cost-effective way.

More info »
TM-Town
Manage your TMs and Terms ... and boost your translation business

Are you ready for something fresh in the industry? TM-Town is a unique new site for you -- the freelance translator -- to store, manage and share translation memories (TMs) and glossaries...and potentially meet new clients on the basis of your prior work.

More info »