PhoneticPair

public struct PhoneticPair

PhoneticPair defines a pair of original string and its phonetic transcription.

Defines a pair of an original string and its phonetic transcription. The purpose is to provide a way to handle and process phonetic representations of strings.

The PhoneticPair struct holds an original string and its phonetic transcription. It processes the phonetic transcription to replace unsupported IPA phonemes with ones supported by AVSpeechSynthesizer. This is useful for text-to-speech operations where phonetic accuracy and compatibility are required.

Important

This is a Public Preview API. It may be changed or removed at any time.
  • Creates an instance of PhoneticPair.

    Important

    In this initialiser the following logic is implemented: It processes the value of phoneticRepresentation input parameter and replaces in it all IPA phonemes not supported by AVSpeechSynthesizer with phonemes supported by AVSpeechSynthesizer. After that, it assigns processed value to phoneticRepresentation.

    Declaration

    Swift

    public init(original: String, phoneticRepresentation: String)

    Parameters

    original

    original string.

    phoneticRepresentation

    phonetic representation of the original string.

  • Original string.

    Declaration

    Swift

    public let original: String
  • Phonetic transcription of the original string.

    Declaration

    Swift

    public let phoneticRepresentation: String