From dee8438682485469bf13fdfe3d86ea39e4ec80c4 Mon Sep 17 00:00:00 2001 From: TheresNoTime Date: Wed, 31 Aug 2022 01:26:36 +0100 Subject: [PATCH] Update README --- README.md | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 8d289c1..5386fc1 100644 --- a/README.md +++ b/README.md @@ -43,7 +43,6 @@ When constructing a new `Validator`, you can set the following options: * @param bool $strip Remove delimiters * @param bool $normalize Normalize IPA * @param bool $google Normalize IPA for Google TTS - * @return void */ public function __construct( $ipa, $strip = true, $normalize = false, $google = false ) ``` @@ -60,14 +59,18 @@ As part of a work project, we're feeding IPA to Google's TTS engine — Google i For example, the IPA `ˈɔːfɫ̩` would not render correctly in Google TTS. A custom charmap is used to normalize certain characters: ```php $charmap = [ - [ "'", 'ˈ' ], - [ ':', 'ː' ], - [ ',', 'ˌ' ], - [ 'ⁿ', 'n' ], // 207F - [ 'ʰ', 'h' ], // 02B0 - [ 'ɫ', 'l' ], // 026B - [ 'ˡ', 'l' ], // 02E1 - [ 'ʲ', 'j' ], // 02B2 + [ '(', '' ], + [ ')', '' ], + // 207F + [ 'ⁿ', 'n' ], + // 02B0 + [ 'ʰ', 'h' ], + // 026B + [ 'ɫ', 'l' ], + // 02E1 + [ 'ˡ', 'l' ], + // 02B2 + [ 'ʲ', 'j' ], ]; ``` Setting `$google` to `true` also removes all diacritics from the IPA string.