Skip to content
This repository has been archived by the owner on Nov 17, 2022. It is now read-only.

Commit

Permalink
Update README
Browse files Browse the repository at this point in the history
  • Loading branch information
theresnotime committed Aug 31, 2022
1 parent 046c270 commit dee8438
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 )
```
Expand All @@ -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.
Expand Down

0 comments on commit dee8438

Please sign in to comment.