2019-07-21 14:48:11 +00:00
|
|
|
|
;;; funcs.el --- Conlanging Layer functions File for Spacemacs
|
|
|
|
|
;;
|
|
|
|
|
;; Copyright (c) 2019-2020 Lucien Cartier-Tilet
|
|
|
|
|
;;
|
|
|
|
|
;; Author: Lucien Cartier-Tilet <phundrak@phundrak.fr>
|
|
|
|
|
;; URL: https://github.com/syl20bnr/spacemacs
|
|
|
|
|
;;
|
|
|
|
|
;; This file is not part of GNU Emacs.
|
|
|
|
|
;;
|
|
|
|
|
;;; License: GPLv3
|
|
|
|
|
|
2019-09-16 13:30:02 +00:00
|
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
|
|
|
; Tree ;
|
|
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
|
|
|
(defun conlanging//declare-node (node-text node-generation)
|
|
|
|
|
"Declares a node in the graphviz source code. The node’s identifier will be
|
|
|
|
|
~node-generation~, and it will bear the label ~node-text~."
|
|
|
|
|
(concat (number-to-string node-generation)
|
|
|
|
|
"[label=\""
|
|
|
|
|
node-text
|
|
|
|
|
"\"];"))
|
|
|
|
|
|
|
|
|
|
(defun conlanging//make-link (previous-node current-node)
|
|
|
|
|
"This creates a link in the graphviz source code between the two nodes
|
|
|
|
|
bearing ~previous-node~ and ~current-node~ respectively as their node
|
|
|
|
|
identifier."
|
|
|
|
|
(concat (number-to-string previous-node) " -- "
|
|
|
|
|
(number-to-string current-node) ";"))
|
|
|
|
|
|
|
|
|
|
(defun conlanging//tree-to-dot-helper (tree current-generation previous-generation)
|
|
|
|
|
"Helper to ~tree-to-dot~ that translates an Elisp tree with any number of
|
|
|
|
|
children per node to a corresponding graphviz file that can be executed from
|
|
|
|
|
dot.
|
|
|
|
|
Arguments:
|
|
|
|
|
- tree :: tree-to-convert
|
|
|
|
|
- current-generation :: Generation number, incremented when changing from a node
|
|
|
|
|
to another node from the same generation, multiplied by 10 when going from
|
|
|
|
|
a node to one of its children.
|
|
|
|
|
- previous-generation :: generation number from previous named node"
|
|
|
|
|
(cond
|
|
|
|
|
((null tree) "")
|
|
|
|
|
((atom (car tree)) ;; '("text" () () ())
|
|
|
|
|
(concat (conlanging//declare-node (car tree) current-generation)
|
|
|
|
|
(conlanging//make-link previous-generation current-generation)
|
|
|
|
|
(conlanging//tree-to-dot-helper (cdr tree)
|
|
|
|
|
(+ 1 (* 10 current-generation))
|
|
|
|
|
current-generation)))
|
|
|
|
|
((listp (car tree)) ;; '(() () ())
|
|
|
|
|
(concat (conlanging//tree-to-dot-helper (car tree) ;; child of current node
|
|
|
|
|
current-generation
|
|
|
|
|
previous-generation)
|
|
|
|
|
(conlanging//tree-to-dot-helper (cdr tree)
|
|
|
|
|
(+ 1 current-generation)
|
|
|
|
|
previous-generation)))))
|
|
|
|
|
|
|
|
|
|
(defun conlanging/tree-to-dot (tree)
|
|
|
|
|
"Returns a graphviz’s dot compatible string representing an Elisp tree"
|
|
|
|
|
(if (null tree) ""
|
|
|
|
|
(concat
|
2019-09-26 14:53:14 +00:00
|
|
|
|
"graph{graph[dpi=300];node[shape=plaintext];graph[bgcolor=\"transparent\"];"
|
2019-09-16 13:30:02 +00:00
|
|
|
|
(conlanging//declare-node (car tree) 0)
|
|
|
|
|
(conlanging//tree-to-dot-helper (cdr tree) 1 0)
|
|
|
|
|
"}")))
|
|
|
|
|
|
2019-09-15 01:57:52 +00:00
|
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
|
|
|
; Common ;
|
|
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
|
|
|
(defun conlanging//replace-string-by-char (t-string t-correspondance-table)
|
|
|
|
|
"Return a copy of t-string converted with the correspondance
|
|
|
|
|
table"
|
|
|
|
|
(interactive)
|
|
|
|
|
(while t-correspondance-table
|
|
|
|
|
(let ((cur-from-char (car (car t-correspondance-table)))
|
|
|
|
|
(cur-to-char (cdr (car t-correspondance-table))))
|
|
|
|
|
(setq t-string (replace-regexp-in-string cur-from-char cur-to-char
|
|
|
|
|
t-string))
|
|
|
|
|
(setq t-correspondance-table (cdr t-correspondance-table))))
|
|
|
|
|
t-string)
|
|
|
|
|
|
|
|
|
|
(defun conlanging//get-boundary ()
|
|
|
|
|
"Get the boundary of either the selected region, or if there is
|
|
|
|
|
none the word the cursor is over"
|
|
|
|
|
(interactive)
|
|
|
|
|
(let* ((beg (region-beginning))
|
|
|
|
|
(end (region-end))
|
|
|
|
|
(boundary-word (bounds-of-thing-at-point 'word)))
|
|
|
|
|
(if (= beg end)
|
|
|
|
|
boundary-word
|
|
|
|
|
(cons beg end))))
|
|
|
|
|
|
|
|
|
|
(defun conlanging//replace-char-by-table (correspondance-table)
|
|
|
|
|
"Replaces selected text’s strings according to the table passed
|
|
|
|
|
as argument. The table is a list of pairs, the first element of
|
|
|
|
|
the pair is a regex to be searched in the selected text and the
|
|
|
|
|
second element of the pair the string it has to be replaced
|
|
|
|
|
with."
|
|
|
|
|
(let* ((cur-boundary (conlanging//get-boundary))
|
|
|
|
|
(beg (car cur-boundary))
|
|
|
|
|
(end (cdr cur-boundary)))
|
|
|
|
|
(setq-local regionp
|
|
|
|
|
(buffer-substring-no-properties beg end))
|
|
|
|
|
(setq-local regionp
|
|
|
|
|
(conlanging//replace-string-by-char regionp
|
|
|
|
|
correspondance-table))
|
|
|
|
|
(delete-region beg end)
|
|
|
|
|
(goto-char beg)
|
|
|
|
|
(insert regionp)))
|
|
|
|
|
|
2019-09-16 13:29:43 +00:00
|
|
|
|
(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))
|
|
|
|
|
|
2019-09-15 01:57:52 +00:00
|
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
|
|
|
; Mattér ;
|
|
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
2019-08-13 14:39:23 +00:00
|
|
|
|
(setq conlanging//matter-latin-to-runes '((", *" . "᛬")
|
2019-08-12 23:52:51 +00:00
|
|
|
|
("\\. *" . "᛭")
|
2019-08-13 14:39:23 +00:00
|
|
|
|
(" +" . "᛫")
|
|
|
|
|
("ċ" . "ᛇ")
|
|
|
|
|
("ch" . "ᛇ")
|
|
|
|
|
("ae" . "ᚫ")
|
|
|
|
|
("æ" . "ᚫ")
|
|
|
|
|
("dh" . "ᛋ")
|
|
|
|
|
("z" . "ᛋ")
|
|
|
|
|
("ð" . "ᛋ")
|
|
|
|
|
("th" . "ᚦ")
|
|
|
|
|
("s" . "ᚦ")
|
|
|
|
|
("þ" . "ᚦ")
|
2019-08-22 18:29:04 +00:00
|
|
|
|
("w" . "ᚹ")
|
2019-08-13 14:39:23 +00:00
|
|
|
|
("ƿ" . "ᚹ")
|
|
|
|
|
("g" . "ᚷ")
|
|
|
|
|
("ᵹ" . "ᚷ")
|
|
|
|
|
("ea" . "ᛠ")
|
|
|
|
|
("f" . "ᚠ")
|
|
|
|
|
("u" . "ᚢ")
|
|
|
|
|
("o" . "ᚩ")
|
|
|
|
|
("r" . "ᚱ")
|
|
|
|
|
("c" . "ᚳ")
|
|
|
|
|
("h" . "ᚻ")
|
|
|
|
|
("n" . "ᚾ")
|
|
|
|
|
("i" . "ᛁ")
|
2019-08-22 18:29:04 +00:00
|
|
|
|
("j" . "ᛄ")
|
2019-08-13 14:39:23 +00:00
|
|
|
|
("p" . "ᛈ")
|
2019-08-22 18:29:04 +00:00
|
|
|
|
("v" . "ᛝ")
|
2019-08-13 14:39:23 +00:00
|
|
|
|
("t" . "ᛏ")
|
|
|
|
|
("b" . "ᛒ")
|
|
|
|
|
("e" . "ᛖ")
|
|
|
|
|
("m" . "ᛗ")
|
|
|
|
|
("l" . "ᛚ")
|
|
|
|
|
("d" . "ᛞ")
|
|
|
|
|
("é" . "ᛟ")
|
|
|
|
|
("a" . "ᚪ")
|
|
|
|
|
("y" . "ᚣ")))
|
2019-09-15 01:57:52 +00:00
|
|
|
|
|
2019-08-12 23:52:51 +00:00
|
|
|
|
(setq conlanging//matter-latin-to-native '((" +" . " ")
|
|
|
|
|
("ch" . "ċ")
|
|
|
|
|
("ae" . "æ")
|
|
|
|
|
("th" . "þ")
|
2019-08-13 14:39:23 +00:00
|
|
|
|
("s" . "þ")
|
2019-08-12 23:52:51 +00:00
|
|
|
|
("dh" . "ð")
|
2019-08-13 14:39:23 +00:00
|
|
|
|
("z" . "ð")
|
|
|
|
|
("w" . "ƿ")
|
|
|
|
|
("j" . "i")))
|
2019-09-15 01:57:52 +00:00
|
|
|
|
|
2019-08-13 14:39:23 +00:00
|
|
|
|
(setq conlanging//matter-latin-to-latex '((", *" . ":")
|
|
|
|
|
("\\. *" . "*")
|
|
|
|
|
(" +" . ".")
|
|
|
|
|
("ch" . "I")
|
|
|
|
|
("ċ" . "I")
|
|
|
|
|
("ae" . "æ")
|
|
|
|
|
("ea" . "\\\\ea")
|
|
|
|
|
("ƿ" . "w")
|
|
|
|
|
("dh" . "s")
|
|
|
|
|
("z" . "s")
|
|
|
|
|
("ð" . "s")
|
|
|
|
|
("th" . "þ")
|
|
|
|
|
("s" . "þ")
|
|
|
|
|
("v" . "\\\\ng")
|
|
|
|
|
("é " . "\\\\oe")))
|
2019-08-12 23:52:51 +00:00
|
|
|
|
|
2019-09-15 01:57:52 +00:00
|
|
|
|
(defun conlanging/matter-to-runes ()
|
|
|
|
|
"Replaces transliterated Mattér with its runic writing system"
|
|
|
|
|
(interactive)
|
|
|
|
|
(conlanging//replace-char-by-table conlanging//matter-latin-to-runes))
|
|
|
|
|
|
|
|
|
|
(defun conlanging/matter-to-native-latin ()
|
|
|
|
|
"Replaces transliterated Mattér with its corresponding native
|
|
|
|
|
latin writing system"
|
|
|
|
|
(interactive)
|
|
|
|
|
(conlanging//replace-char-by-table conlanging//matter-latin-to-native))
|
|
|
|
|
|
|
|
|
|
(defun conlanging/matter-to-latex ()
|
|
|
|
|
"Replaces transliterated Mattér with its corresponding runes"
|
|
|
|
|
(interactive)
|
|
|
|
|
(conlanging//replace-char-by-table conlanging//matter-latin-to-latex))
|
|
|
|
|
|
|
|
|
|
(defun conlanging/matter-org-export-runes (text)
|
|
|
|
|
"Replaces transliterated Mattér with its corresponding runes during org-mode
|
|
|
|
|
export"
|
|
|
|
|
(interactive)
|
|
|
|
|
(if (org-export-derived-backend-p org-export-current-backend
|
|
|
|
|
'latex)
|
|
|
|
|
(concat "\\textarm{"
|
|
|
|
|
(conlanging//replace-string-by-char text conlanging//matter-latin-to-latex)
|
|
|
|
|
"}")
|
|
|
|
|
(conlanging//replace-string-by-char text conlanging//matter-latin-to-runes)))
|
|
|
|
|
|
|
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
|
|
|
; Eittlanda ;
|
|
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
2019-08-21 12:57:03 +00:00
|
|
|
|
(setq conlanging//eittlanda-latin-to-latex '((", *" . "\\\\tripledot")
|
2019-08-12 23:52:51 +00:00
|
|
|
|
("\\. *" . "\\\\tripledot")
|
2019-08-13 14:39:23 +00:00
|
|
|
|
(" +" . ":")
|
2019-09-11 18:00:36 +00:00
|
|
|
|
("hv" . "x")
|
2019-08-13 14:39:23 +00:00
|
|
|
|
("ø" . "\\\\o")
|
2019-09-12 17:12:27 +00:00
|
|
|
|
("œ" . "\\\\oO")
|
2019-09-13 16:37:15 +00:00
|
|
|
|
("v" . "w")
|
2019-08-13 14:39:23 +00:00
|
|
|
|
("ó" . "v")
|
2019-09-13 16:37:15 +00:00
|
|
|
|
("ń" . "\\\\ndot")))
|
2019-09-15 01:57:52 +00:00
|
|
|
|
|
2019-08-21 12:57:03 +00:00
|
|
|
|
(setq conlanging//eittlanda-latin-to-runes '((", *" . "⁝")
|
2019-08-12 23:52:51 +00:00
|
|
|
|
("\\. *" . "⁝")
|
2019-08-13 14:39:23 +00:00
|
|
|
|
(" +" . "᛬")
|
2019-08-23 11:45:26 +00:00
|
|
|
|
(":" . "᛬")
|
2019-09-11 18:00:36 +00:00
|
|
|
|
("hv" . "ᛪ")
|
2019-08-13 14:39:23 +00:00
|
|
|
|
("i" . "ᛁ")
|
|
|
|
|
("y" . "ᛦ")
|
|
|
|
|
("u" . "ᚢ")
|
|
|
|
|
("e" . "ᛂ")
|
|
|
|
|
("ø" . "ᚯ")
|
|
|
|
|
("o" . "ᚮ")
|
2019-09-12 17:12:27 +00:00
|
|
|
|
("œ" . "ᚰ")
|
2019-08-13 14:39:23 +00:00
|
|
|
|
("ó" . "ᚤ")
|
|
|
|
|
("æ" . "ᛅ")
|
|
|
|
|
("a" . "ᛆ")
|
|
|
|
|
("m" . "ᛘ")
|
|
|
|
|
("n" . "ᚾ")
|
|
|
|
|
("ń" . "ᛀ")
|
|
|
|
|
("p" . "ᛔ")
|
|
|
|
|
("b" . "ᛒ")
|
|
|
|
|
("t" . "ᛐ")
|
|
|
|
|
("d" . "ᛑ")
|
|
|
|
|
("k" . "ᚴ")
|
|
|
|
|
("g" . "ᚵ")
|
|
|
|
|
("f" . "ᚠ")
|
|
|
|
|
("þ" . "ᚦ")
|
|
|
|
|
("ð" . "ᚧ")
|
|
|
|
|
("s" . "ᛋ")
|
|
|
|
|
("h" . "ᚼ")
|
2019-08-22 18:29:04 +00:00
|
|
|
|
("v" . "ᚥ")
|
2019-08-13 14:39:23 +00:00
|
|
|
|
("r" . "ᚱ")
|
|
|
|
|
("l" . "ᛚ")))
|
2019-07-21 14:48:11 +00:00
|
|
|
|
|
2019-08-21 12:57:03 +00:00
|
|
|
|
(defun conlanging/eittlanda-to-runes ()
|
|
|
|
|
"Replaces transliterated Eittlandic with its runic writing system"
|
2019-08-12 23:52:51 +00:00
|
|
|
|
(interactive)
|
2019-08-21 12:57:03 +00:00
|
|
|
|
(conlanging//replace-char-by-table conlanging//eittlanda-latin-to-runes))
|
2019-07-21 14:48:11 +00:00
|
|
|
|
|
2019-08-21 12:57:03 +00:00
|
|
|
|
(defun conlanging/eittlanda-to-latex ()
|
|
|
|
|
"Replaces transliterated Eittlandic with its corresponding runes"
|
2019-08-13 14:39:23 +00:00
|
|
|
|
(interactive)
|
2019-08-21 12:57:03 +00:00
|
|
|
|
(conlanging//replace-char-by-table conlanging//eittlanda-latin-to-latex))
|
2019-08-13 14:39:23 +00:00
|
|
|
|
|
2019-08-21 12:57:03 +00:00
|
|
|
|
(defun conlanging/eittlanda-org-export-runes (text)
|
2019-09-15 01:57:52 +00:00
|
|
|
|
"Replaces transliterated Eittlandic with its corresponding
|
|
|
|
|
runes during org-mode export"
|
2019-07-21 14:48:11 +00:00
|
|
|
|
(interactive)
|
2019-08-13 14:39:23 +00:00
|
|
|
|
(if (org-export-derived-backend-p org-export-current-backend
|
|
|
|
|
'latex)
|
|
|
|
|
(concat "\\textarm{"
|
2019-08-21 12:57:03 +00:00
|
|
|
|
(conlanging//replace-string-by-char text conlanging//eittlanda-latin-to-latex)
|
2019-08-13 14:39:23 +00:00
|
|
|
|
"}")
|
2019-08-21 12:57:03 +00:00
|
|
|
|
(conlanging//replace-string-by-char text conlanging//eittlanda-latin-to-runes)))
|
2019-09-15 01:58:20 +00:00
|
|
|
|
|
|
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
2019-09-26 14:53:14 +00:00
|
|
|
|
; Ñyqy ;
|
2019-09-15 01:58:20 +00:00
|
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
|
|
|
(setq conlanging//nyqy-phonetics '(("q" t t "q" "ħ")
|
|
|
|
|
("g" t t "ɢ" "ʢ")
|
2019-09-26 14:53:14 +00:00
|
|
|
|
("ñ" t t "ɴ" "m")
|
2019-09-15 01:58:20 +00:00
|
|
|
|
("c" t t "t͡ʃ" "ɬ")
|
|
|
|
|
("j" t t "d͡ʒ" "ɮ")
|
|
|
|
|
("w" t t "w" "l")
|
|
|
|
|
("p" t nil "p" "χ")
|
|
|
|
|
("b" t nil "b" "ʁ")
|
|
|
|
|
("m" t nil "m" "ʀ")
|
|
|
|
|
("n" t nil "n" "j")
|
|
|
|
|
("s" t nil "s" "x")
|
|
|
|
|
("z" t nil "z" "ɣ")
|
|
|
|
|
("y" nil nil "y")
|
|
|
|
|
("ú" nil nil "u")
|
|
|
|
|
("i" nil nil "ɪ")
|
|
|
|
|
("u" nil nil "ʊ")
|
2019-11-15 14:40:37 +00:00
|
|
|
|
("é" nil nil "ø")
|
|
|
|
|
("ó" nil nil "ɤ")
|
2019-09-15 01:58:20 +00:00
|
|
|
|
("e" nil nil "ɛ")
|
|
|
|
|
("o" nil nil "ɔ")
|
|
|
|
|
(" " nil nil " ")
|
|
|
|
|
("," nil nil " ")
|
|
|
|
|
(";" nil nil " ")
|
|
|
|
|
("." nil nil " ")))
|
|
|
|
|
|
2019-09-16 13:29:43 +00:00
|
|
|
|
(defun conlanging//nyqy-is-consonant (elem)
|
2019-09-15 01:58:20 +00:00
|
|
|
|
(nth 1 elem))
|
|
|
|
|
|
2019-09-16 13:29:43 +00:00
|
|
|
|
(defun conlanging//nyqy-is-dorsal (elem)
|
2019-09-15 01:58:20 +00:00
|
|
|
|
(nth 2 elem))
|
|
|
|
|
|
2019-09-15 03:10:02 +00:00
|
|
|
|
(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))
|
2019-09-15 01:58:20 +00:00
|
|
|
|
|
|
|
|
|
(defun conlanging//nyqy-convert (text phonetics need-dorsal)
|
|
|
|
|
"
|
|
|
|
|
need-dorsal: initial = 2, sinon t ou nil
|
|
|
|
|
"
|
|
|
|
|
(if (null text)
|
|
|
|
|
(mapconcat 'identity phonetics "")
|
|
|
|
|
(let* ((curr-char (car text))
|
|
|
|
|
(curr-phon-list (conlanging//find-elem-in-list curr-char conlanging//nyqy-phonetics))
|
2019-09-16 13:29:43 +00:00
|
|
|
|
(consonant (conlanging//nyqy-is-consonant curr-phon-list))
|
|
|
|
|
(dorsal (conlanging//nyqy-is-dorsal curr-phon-list))
|
2019-09-15 03:10:02 +00:00
|
|
|
|
(phon (conlanging//nyqy-get-phoneme consonant curr-phon-list
|
|
|
|
|
need-dorsal dorsal)))
|
2019-09-15 01:58:20 +00:00
|
|
|
|
(if (eq need-dorsal 2)
|
2019-11-15 14:40:37 +00:00
|
|
|
|
(setq-local need-dorsal dorsal))
|
2019-09-15 01:58:20 +00:00
|
|
|
|
(conlanging//nyqy-convert (cdr text)
|
|
|
|
|
(append phonetics
|
|
|
|
|
(list phon))
|
|
|
|
|
(if consonant
|
|
|
|
|
(not need-dorsal)
|
|
|
|
|
need-dorsal)))))
|
|
|
|
|
|
|
|
|
|
(defun conlanging/nyqy-to-phonetics (text)
|
2019-09-26 14:53:14 +00:00
|
|
|
|
"Adds to Ñyqy text its phonetics equivalent, either as a
|
2019-09-15 01:58:20 +00:00
|
|
|
|
tooltip in HTML or as plain text appended in LaTeX.
|
|
|
|
|
|
|
|
|
|
Arguments:
|
|
|
|
|
- text: text to convert to phonetics"
|
|
|
|
|
(interactive)
|
|
|
|
|
(setq-local phonetics
|
2019-09-15 03:10:02 +00:00
|
|
|
|
(conlanging//nyqy-convert (split-string (downcase text)
|
|
|
|
|
""
|
|
|
|
|
t)
|
2019-09-15 01:58:20 +00:00
|
|
|
|
()
|
|
|
|
|
2))
|
2019-09-15 03:10:02 +00:00
|
|
|
|
(concat "@@html:<span class=\"tooltip\"><i>"
|
|
|
|
|
text "</i><span class=\"tooltiptext\">/" phonetics
|
|
|
|
|
"/</span></span>@@@@latex:\\textit{" text
|
|
|
|
|
"} (/" phonetics "/)@@"))
|