From fd364577901971225644c57a167c265094085ccb Mon Sep 17 00:00:00 2001 From: Phuntsok Drak-pa Date: Sun, 15 Sep 2019 05:10:02 +0200 Subject: [PATCH] fixed bad consonant choosing --- funcs.el | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/funcs.el b/funcs.el index 16fc55a..4c4eb16 100644 --- a/funcs.el +++ b/funcs.el @@ -249,11 +249,14 @@ runes during org-mode export" (defun conlanging//is-dorsal (elem) (nth 2 elem)) -(defun conlanging//nyqy-get-phoneme (consonant phon need-dorsal) - (let* ((is-dorsal (nth 1 phon))) - (nth (if (or (eq need-dorsal 2) (not consonant)) 3 - (if (eq is-dorsal need-dorsal) 3 4)) - phon))) +(defun conlanging//nyqy-get-phoneme (consonant phon need-dorsal is-dorsal) + (nth (if (or (eq need-dorsal 2) + (not consonant)) + 3 + (if (eq is-dorsal need-dorsal) + 3 + 4)) + phon)) (defun conlanging//find-elem-in-list (elem 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)) (consonant (conlanging//is-consonant 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) (setq need-dorsal dorsal)) (conlanging//nyqy-convert (cdr text) @@ -294,11 +298,12 @@ Arguments: - text: text to convert to phonetics" (interactive) (setq-local phonetics - (conlanging//nyqy-convert (split-string text "" t) + (conlanging//nyqy-convert (split-string (downcase text) + "" + t) () 2)) - (if (org-export-derived-backend-p org-export-current-backend - 'latex) - (concat text " /" phonetics "/") - (concat text " /" - phonetics "/"))) + (concat "@@html:" + text "/" phonetics + "/@@@@latex:\\textit{" text + "} (/" phonetics "/)@@"))