The following code:
AVSpeechSynthesizer * speechSynthesizer = [[AVSpeechSynthesizer alloc] init];
AVSpeechUtterance *utterance = [AVSpeechUtterance speechUtteranceWithString: @"112"];
utterance.voice = [AVSpeechSynthesisVoice voiceWithLanguage:@"en-GB"];
speechSynthesizer speakUtterance:utterance];
results in with the device saying: "one hundred and twelve" (British spelling)
But if instead you transliterate the number 112:
NSString * wordNumber = nil;
NSNumberFormatter *numberFormatter = [[NSNumberFormatter alloc] init];
[numberFormatter setLocale:[[NSLocale alloc] initWithLocaleIdentifier:@"en-GB"]];
[numberFormatter setNumberStyle:NSNumberFormatterSpellOutStyle];
wordNumber = [numberFormatter stringFromNumber:@(112)];
now wordNumber contains "one hundred twelve" (without the and particle).
So:
@"112" -> AVSpeechSynthesizer -> "one hundred and twelve"
@"112" -> NSNumberFormatter -> "one hundred twelve"
How can I transliterate a number with the and particles,i.e, British spelling?
I believe you'll need to do this yourself. I haven't been able to produce your desired result or find any resource that allows me to do so.
I've linked to a question that demonstrates how to do this manually.
Is it possible to spell out numbers in words with a separator?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With