(require 'uni-scripts))
(defun textsec-scripts (string)
- "Return a list of scripts used in STRING."
+ "Return a list of Unicode scripts used in STRING.
+The scripts returned by this function use the Unicode Script property
+as defined by the Unicode Standard Annex 24 (UAX#24)."
(seq-map (lambda (char)
(elt textsec--char-scripts char))
string))
(defun textsec-single-script-p (string)
- "Return non-nil if STRING is all in a single script.
+ "Return non-nil if STRING is all in a single Unicode script.
Note that the concept of \"single script\" used by this function
isn't obvious -- some mixtures of scripts count as a \"single
https://www.unicode.org/reports/tr39/#Mixed_Script_Detection
-for details."
+for details. The Unicode scripts are as defined by the
+Unicode Standard Annex 24 (UAX#24)."
(let ((scripts (mapcar
(lambda (s)
(append s
(defun textsec-covering-scripts (string)
"Return a minimal list of scripts used in STRING.
-Not that a string may have several different minimal cover sets."
+Not that a string may have several different minimal cover sets.
+The scripts are as defined by the Unicode Standard Annex 24 (UAX#24)."
(let* ((scripts (textsec-scripts string))
(set (car scripts)))
(dolist (s scripts)