T313494: Warn the user if they use unsupported IPA could be solved a lot easier if there is a pre-existing library/regex/etc. which would allow us to check inputted IPA strings
Description
Description
| Status | Subtype | Assigned | Task | ||
|---|---|---|---|---|---|
| Resolved | MusikAnimal | T313711 Investigate Google SSML/IPA rendering issues | |||
| Declined | None | T313494 Warn the user if they use unsupported IPA | |||
| Resolved | Spike | TheresNoTime | T314375 [4 hours] Investigate IPA validator methods |
Event Timeline
Comment Actions
Nothing really exists that I could find, so I threw together https://github.com/theresnotime/ipa-validator this evening, which has probably the most upsetting regex I've ever seen:
const regex = new RegExp('^[pbtdʈɖcɟkɡqɢʔmɱnɳɲŋɴʙrʀⱱɾɽɸβfvθðszʃʒʂʐçʝxɣχʁħʕhɦɬɮʋɹɻjɰlɭʎʟʘǀǃǂǁɓɗʄɠʛʼiyɨʉɯuɪʏʊeøɘj̊uɵɤoəɛœɜɞʌɔæɐaɶɑɒʍwɥʜʢʡɕʑɺɧ͜͡ˈˌːˑ̆|‖.‿̥̬ʰ̹̜̟̠̩̯̈̽˞̤̰̼ʷʲˠˤ̴̝̞̘̙̪̺̻̃ⁿˡ̋̚˥̌˩́˦̂̄˧᷄̀˨᷅̏᷈ɚ()ˀɝɫ̩]+$', 'gui');
The tests are fairly promising in terms of validating the correct Unicode etc..