Regex for Chinese Numbers

In a scenario of source/target = English to Simp Chin, is there a way to leverage Regex so that numbers above 10,000 in English are properly rendered in Chinese?

  • Hi Susan,

    If you mean convert them to Chinese characters then I'm afraid this is not possible unless you were to list every possible number from 10,001 upwards and it's Chinese equivalent. Then you could use the regex autosuggest application to handle the conversion. But obviously this is not practical at all.

    I had a play using machine translation to see whether this might provide a solution but both Google and Language Cloud convert to western characters, so this wasn't helpful either.

    Maybe someone like has a solution for this kind of problem?

    Regards

    Paul

    Paul Filkin | RWS

    Design your own training!
    You've done the courses and still need to go a little further, or still not clear? 
    Tell us what you need in our Community Solutions Hub

  • Paul, I have the same question as you. I don't know what the original poster means by "rendered properly". If I want to use Chinese characters for 10,000 and above, I just type it up since my Regex knowledge is very limited. If I want to keep the same Western number format, then I use copy source to target or quick insert. Studio is actually pretty good at handling numbers.
  • Hi Paul,
    Thanks so much for your reply.
    No, I don't mean convert to Chinese characters, but to the proper Chinese format. For example, 1 million/1,000000 in English is 100万
    (meaning is [100x 10,000]. I'll ask Chunyi, as suggested.
  • Hi Chunyi,

    Probably 'localized properly' would have been the better term for my query. What do I need to do to tag [ 1,000,000] in source (English], and have the resulting target be 100万? Thank you.
  • Hi Susan,

    I just translate it the old-fashioned way without using any method(s) to automate the process. Now that you mention it, it makes me think there may be a faster way to do it--I would love to know:)

    Chunyi
  • I'm a beginner at regex as well, so this is very messy, but it works. I had installed Regex Match Auto-suggest plugin, and then I entered such strings:

    ([0-9]{1})([0-9]{1})([,\s])([0-9]{3}) $1,$2$4
    ([0-9]{1})([,\s])([0-9]{3}) $1$3
    ([0-9]{2})([0-9]{1})([,\s])([0-9]{3}) $1,$2$4
    ([0-9]{1})([,\s])([0-9]{2})([0-9]{1})([,\s])([0-9]{3}) $1$3,$4$6
    ([0-9]{2})([,\s])([0-9]{2})([0-9]{1})([,\s])([0-9]{3}) $1$3,$4$6
    ([0-9]{1})([0-9]{2})([,\s])([0-9]{2})([0-9]{1})([,\s])([0-9]{3}) $1,$2$4,$5$7
    ([0-9]{1})([,\s])([0-9]{1})([0-9]{2})([,\s])([0-9]{2})([0-9]{1})([,\s])([0-9]{3}) $1$3,$4$6$2$7$9
    ([0-9]{1})([,\s])([0-9]{3})([.,]([0-9]*)) $1$3$4
    ([0-9]{1})([0-9]{1})([,\s])([0-9]{3})([.,]([0-9]*)) $1,$2$4$5
    ([0-9]{2})([0-9]{1})([,\s])([0-9]{3})(.([0-9]*)) $1,$2$4$5
    ([0-9]{1})([,\s])([0-9]{2})([0-9]{1})([,\s])([0-9]{3})(.([0-9]*)) $1$3,$4$6$7
    ([0-9]{2})([,\s])([0-9]{2})([0-9]{1})([,\s])([0-9]{3})(.([0-9]*)) $1$3,$4$6$7
    ([0-9]{1})([0-9]{2})([,\s])([0-9]{2})([0-9]{1})([,\s])([0-9]{3})([,.]([0-9]*)) $1,$2$4,$5$7$8
    ([0-9]{1})([,\s])([0-9]{1})([0-9]{2})([,\s])([0-9]{2})([0-9]{1})([,\s])([0-9]{3})(.([0-9]*)) $1$3,$4$6,$7$9$10

    But it only works INTO Chinese from English and Polish up to: 0,000,000,000.00->00,0000,0000.00 . I do not know how to make it work for all numbers or how to make it use the 0.000万 method. Making it work the over way round would require a new set of strings that I have not written yet.
  • I guess it gets tricky unless we know the patterns. So far we know this one:

    100万

    This equals 100 x 10,000 or 1,000,000

    But what others are there? For example, how would you write these numbers?

    3
    17
    287
    3,876
    43,985
    520,456
    1,456,768
    23,456,102
    327,657,105
    9,436,890,111

    What are the rules for writing numbers in Chinese and can they be easily transformed? I didn't even touch decimals but I guess this would add more complexity?

    Regards

    Paul

    Paul Filkin | RWS

    Design your own training!
    You've done the courses and still need to go a little further, or still not clear? 
    Tell us what you need in our Community Solutions Hub