Need help with voice translation rule

Unanswered Question
Sep 15th, 2009
User Badges:

I wanted to create a rule that would match any number and append "1" to the number. I have created a sample voice translation:


voice translation-rule 2250

rule 1 /^(.+)/ /1\1/


but when I test the rule:


test voice translation-rule 2250 9047580977

9047580977 Didn't match with any of rules


How come?

  • 1
  • 2
  • 3
  • 4
  • 5
Overall Rating: 0 (0 ratings)
Loading.
francisv Tue, 09/15/2009 - 01:49
User Badges:

Solved it. I had to add the "\" character before the "(" and ")" characters to get a match.


voice translation-rule 2250

rule 1 /^\(.+\)/ /1\1/


test voice translation-rule 2250 9047580977

Matched with rule 1

Original number: 9047580977 Translated number: 19047580977


I'm happy with this result.

paolo bevilacqua Tue, 09/15/2009 - 06:07
User Badges:
  • Super Gold, 25000 points or more
  • Hall of Fame,

    Founding Member

You said that you wanted to append, not prepend. This is done more simply as:


rule 1 // /1/


Because // matches an empty string "before" the number", and the rest is copied unchanged.

Actions

This Discussion