Add word games list to improve misspellings in the future

This commit is contained in:
Gerard Vermeulen 2022-09-12 07:01:03 +02:00
parent f59f6aecfd
commit 50540104b8
1 changed files with 28 additions and 0 deletions

View File

@ -3217,6 +3217,34 @@ abbreviation definitions in this file by means of:
(setq-default abbrev-mode t))
#+end_src
Listing [[lst:word-games]] defines the =anagram-p= function that migth be used for a
better exploitation of [[https://en.wikipedia.org/wiki/Wikipedia:Lists_of_common_misspellings/For_machines][Wikipedia's list of common misspellings for machines]] in
the future.
#+caption[Word games]:
#+caption: Word games.
#+name: lst:word-games
#+begin_src emacs-lisp
;; https://funcall.blogspot.com/2022/07/lets-play-wordle.html
;; https://github.com/tabatkins/wordle-list
(defun anagram-p (evil vile)
"Check whether strings EVIL and VILE are anagrams of each other."
(if (string= evil vile)
nil
(string= (cl-sort evil #'<) (cl-sort vile #'<))))
;; https://funcall.blogspot.com/2020/01/palindromes-redux-and-sufficiently.html
;; https://irreal.org/blog/?p=8570
(defun palindrome-p (word)
"Check whether the string WORD is a palindrome."
(cl-do ((head 0 (1+ head))
(tail (1- (length word)) (1- tail))
(ok t))
((or (not ok) (>= head tail) ok)
(setq ok (= (aref word head) (aref word tail))))))
#+end_src
*** [[https://github.com/tecosaur/lexic#readme][Emacs LEXICal information viewer]]
:PROPERTIES:
:CUSTOM_ID: sec:writing-lexic