diff --git a/t_phonenumber_egypt_3_4.go b/t_phonenumber_egypt_3_4.go index 110182f..310dcde 100644 --- a/t_phonenumber_egypt_3_4.go +++ b/t_phonenumber_egypt_3_4.go @@ -2,6 +2,7 @@ package arbitrary import ( "fmt" + "strings" ) func (arb T) phonenumber_egypt_3_4(areacode string) string { @@ -31,6 +32,21 @@ func (arb T) phonenumber_egypt_3_4(areacode string) string { result = fmt.Sprintf(format, areacode, localpart1, localpart2) } + { + if 0 == arb.randomness.Intn(4) { + result = strings.ReplaceAll(result, "0", "٠") + result = strings.ReplaceAll(result, "1", "١") + result = strings.ReplaceAll(result, "2", "٢") + result = strings.ReplaceAll(result, "3", "٣") + result = strings.ReplaceAll(result, "4", "٤") + result = strings.ReplaceAll(result, "5", "٥") + result = strings.ReplaceAll(result, "6", "٦") + result = strings.ReplaceAll(result, "7", "٧") + result = strings.ReplaceAll(result, "8", "٨") + result = strings.ReplaceAll(result, "9", "٩") + } + } + return result } diff --git a/t_phonenumber_egypt_4_4.go b/t_phonenumber_egypt_4_4.go index 083c76a..922238e 100644 --- a/t_phonenumber_egypt_4_4.go +++ b/t_phonenumber_egypt_4_4.go @@ -2,6 +2,7 @@ package arbitrary import ( "fmt" + "strings" ) func (arb T) phonenumber_egypt_4_4(areacode string) string { @@ -31,6 +32,20 @@ func (arb T) phonenumber_egypt_4_4(areacode string) string { result = fmt.Sprintf(format, areacode, localpart1, localpart2) } + { + if 0 == arb.randomness.Intn(4) { + result = strings.ReplaceAll(result, "0", "٠") + result = strings.ReplaceAll(result, "1", "١") + result = strings.ReplaceAll(result, "2", "٢") + result = strings.ReplaceAll(result, "3", "٣") + result = strings.ReplaceAll(result, "4", "٤") + result = strings.ReplaceAll(result, "5", "٥") + result = strings.ReplaceAll(result, "6", "٦") + result = strings.ReplaceAll(result, "7", "٧") + result = strings.ReplaceAll(result, "8", "٨") + result = strings.ReplaceAll(result, "9", "٩") + } + } + return result } -