summaryrefslogtreecommitdiff
path: root/gnosis.el
diff options
context:
space:
mode:
Diffstat (limited to 'gnosis.el')
-rw-r--r--gnosis.el8
1 files changed, 8 insertions, 0 deletions
diff --git a/gnosis.el b/gnosis.el
index 09d86d2..cbc053b 100644
--- a/gnosis.el
+++ b/gnosis.el
@@ -1116,6 +1116,14 @@ TYPE: Type of gnosis note, must be one of `gnosis-note-types'"
(history-add-new-input nil)) ;; Disable history
(gnosis-completing-read "Answer: " choices)))
+(defun gnosis-cloze-check (sentence clozes)
+ "Check if CLOZES are found in SENTENCE."
+ (catch 'not-found
+ (dolist (cloze clozes)
+ (unless (string-match-p cloze sentence)
+ (throw 'not-found nil)))
+ t))
+
(defun gnosis-cloze-remove-tags (string)
"Replace cloze tags and hints in STRING.