diff options
author | Thanos Apollo <[email protected]> | 2024-07-16 09:47:37 +0300 |
---|---|---|
committer | Thanos Apollo <[email protected]> | 2024-07-16 09:47:37 +0300 |
commit | 7230e3f8c720d986b97c8e090cd34019947b4426 (patch) | |
tree | c0e4d6c68016a9d18627e415d64a6b79763f90c6 /gnosis.el | |
parent | 176f892230a57dd567bb83300d48be4d8a79e867 (diff) |
New function: Add gnosis-cloze-check
Check if clozes are part of the sentence
Diffstat (limited to 'gnosis.el')
-rw-r--r-- | gnosis.el | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -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. |