elsanussi-s-mneina / phonetics-modeling

trying to model facts of phonetics and phonemes in Haskell
MIT License
0 stars 0 forks source link

Find a better way to parse #14

Open elsanussi-s-mneina opened 4 years ago

elsanussi-s-mneina commented 4 years ago

The constructIPA, and analyzeIPA functions are difficult to extend to handle new diacritics. Not only, does the programmer have to add code in both functions when adding support for each diacritic, the exact location in the code where the condition is added is crucial to getting it right. There are most likely better ways to do this. Specifically: improving the task of converting a string of characters to a phoneme, and back. Suggestion: context free grammars, or parser combinators

elsanussi-s-mneina commented 4 years ago

Some parser combinators are in the PrimitiveParsers module (PrimitiveParsers.hs), but so far they are only used to split text by phoneme. I'm not sure if there is a context free grammar for IPA. I would need to find out what the constraints are for which diacritic comes before the other to do it right. We may have to add a stage in between where we reorder diacritics because it is unlikely that linguists always type the diacritics in a particular order.