From 8e6a12d91dce073287e1bdafd16383f90bdac622 Mon Sep 17 00:00:00 2001 From: Phuntsok Drak-pa Date: Mon, 16 Sep 2019 15:29:43 +0200 Subject: [PATCH] moved and renamed some nyqy-related functions --- funcs.el | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/funcs.el b/funcs.el index 4c4eb16..29bb859 100644 --- a/funcs.el +++ b/funcs.el @@ -53,6 +53,17 @@ with." (goto-char beg) (insert regionp))) +(defun conlanging//find-elem-in-list (elem list) + "In a list containing lists, returns the element of `list' +whose first element equals `elem'" + (if list + (if (string= (caar list) + elem) + (car list) + (conlanging//find-elem-in-list elem + (cdr list))) + nil)) + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; Mattér ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -243,10 +254,10 @@ runes during org-mode export" (";" nil nil " ") ("." nil nil " "))) -(defun conlanging//is-consonant (elem) +(defun conlanging//nyqy-is-consonant (elem) (nth 1 elem)) -(defun conlanging//is-dorsal (elem) +(defun conlanging//nyqy-is-dorsal (elem) (nth 2 elem)) (defun conlanging//nyqy-get-phoneme (consonant phon need-dorsal is-dorsal) @@ -258,17 +269,6 @@ runes during org-mode export" 4)) phon)) -(defun conlanging//find-elem-in-list (elem list) - "In a list containing lists, returns the element of `list' -whose first element equals `elem'" - (if list - (if (string= (caar list) - elem) - (car list) - (conlanging//find-elem-in-list elem - (cdr list))) - nil)) - (defun conlanging//nyqy-convert (text phonetics need-dorsal) " need-dorsal: initial = 2, sinon t ou nil @@ -277,8 +277,8 @@ need-dorsal: initial = 2, sinon t ou nil (mapconcat 'identity phonetics "") (let* ((curr-char (car text)) (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)) + (consonant (conlanging//nyqy-is-consonant curr-phon-list)) + (dorsal (conlanging//nyqy-is-dorsal curr-phon-list)) (phon (conlanging//nyqy-get-phoneme consonant curr-phon-list need-dorsal dorsal))) (if (eq need-dorsal 2)