Fix crash on unknown character

This commit allows any unknown characters to be passed in text fed to
`conlanging-proto-nyqy-to-phonetics' without any crash. Unrecognized
characters will just be ignored.
This commit is contained in:
Lucien Cartier-Tilet 2021-06-28 23:10:35 +02:00
parent ff60fddaf4
commit 77799b0e96
Signed by: phundrak
GPG Key ID: BD7789E705CB8DCA
1 changed files with 11 additions and 10 deletions

View File

@ -340,16 +340,17 @@ See `conlanging--proto-nyqy-phoneme'.")
(equal (oref elem :grapheme)
grapheme))
conlanging--proto-nyqy-phonetics)))
(if (oref cur-phoneme :is-consonant)
(progn
(when (eq dorsal 'undefined)
(setq dorsal (oref cur-phoneme :is-dorsal)))
(setq phonetics (concat phonetics
(if dorsal
(oref cur-phoneme :phoneme)
(oref cur-phoneme :alt-phoneme))))
(setq dorsal (not dorsal)))
(setq phonetics (concat phonetics (oref cur-phoneme :phoneme))))))
(when cur-phoneme
(if (oref cur-phoneme :is-consonant)
(progn
(when (eq dorsal 'undefined)
(setq dorsal (oref cur-phoneme :is-dorsal)))
(setq phonetics (concat phonetics
(if dorsal
(oref cur-phoneme :phoneme)
(oref cur-phoneme :alt-phoneme))))
(setq dorsal (not dorsal)))
(setq phonetics (concat phonetics (oref cur-phoneme :phoneme)))))))
phonetics))
;;;###autoload