fixed bad consonant choosing

This commit is contained in:
Phuntsok Drak-pa 2019-09-15 05:10:02 +02:00
parent 757ac2ea2d
commit fd36457790

View File

@ -249,11 +249,14 @@ runes during org-mode export"
(defun conlanging//is-dorsal (elem) (defun conlanging//is-dorsal (elem)
(nth 2 elem)) (nth 2 elem))
(defun conlanging//nyqy-get-phoneme (consonant phon need-dorsal) (defun conlanging//nyqy-get-phoneme (consonant phon need-dorsal is-dorsal)
(let* ((is-dorsal (nth 1 phon))) (nth (if (or (eq need-dorsal 2)
(nth (if (or (eq need-dorsal 2) (not consonant)) 3 (not consonant))
(if (eq is-dorsal need-dorsal) 3 4)) 3
phon))) (if (eq is-dorsal need-dorsal)
3
4))
phon))
(defun conlanging//find-elem-in-list (elem list) (defun conlanging//find-elem-in-list (elem list)
"In a list containing lists, returns the element of `list' "In a list containing lists, returns the element of `list'
@ -276,7 +279,8 @@ need-dorsal: initial = 2, sinon t ou nil
(curr-phon-list (conlanging//find-elem-in-list curr-char conlanging//nyqy-phonetics)) (curr-phon-list (conlanging//find-elem-in-list curr-char conlanging//nyqy-phonetics))
(consonant (conlanging//is-consonant curr-phon-list)) (consonant (conlanging//is-consonant curr-phon-list))
(dorsal (conlanging//is-dorsal curr-phon-list)) (dorsal (conlanging//is-dorsal curr-phon-list))
(phon (conlanging//nyqy-get-phoneme consonant curr-phon-list need-dorsal))) (phon (conlanging//nyqy-get-phoneme consonant curr-phon-list
need-dorsal dorsal)))
(if (eq need-dorsal 2) (if (eq need-dorsal 2)
(setq need-dorsal dorsal)) (setq need-dorsal dorsal))
(conlanging//nyqy-convert (cdr text) (conlanging//nyqy-convert (cdr text)
@ -294,11 +298,12 @@ Arguments:
- text: text to convert to phonetics" - text: text to convert to phonetics"
(interactive) (interactive)
(setq-local phonetics (setq-local phonetics
(conlanging//nyqy-convert (split-string text "" t) (conlanging//nyqy-convert (split-string (downcase text)
""
t)
() ()
2)) 2))
(if (org-export-derived-backend-p org-export-current-backend (concat "@@html:<span class=\"tooltip\"><i>"
'latex) text "</i><span class=\"tooltiptext\">/" phonetics
(concat text " /" phonetics "/") "/</span></span>@@@@latex:\\textit{" text
(concat text " <span class=\"tooltip\">/" "} (/" phonetics "/)@@"))
phonetics "/</span>")))