all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Emanuel Berg <incal@dataswamp.org>
To: help-gnu-emacs@gnu.org
Subject: Re: Testing validity of a word
Date: Wed, 26 Jul 2023 14:06:48 +0200	[thread overview]
Message-ID: <87sf9ax4fb.fsf@dataswamp.org> (raw)
In-Reply-To: 0iMfp4ZIF6AbexWeuBv10ON9NQqnHhsYhLbUaqzCte_f2yasnqcZbnZuHiCmWYiLZP_1DdWvaWLBlX0np-1eKeg-RUeySDbv8rya570hG9M=@proton.me

uzibalqa wrote:

> I want to test whether a word is valid. Is there a package
> in Emacs for dictionary word lookup ?

(defun spell-word (word)
  (with-temp-buffer
    (save-excursion
      (insert word) )
    (condition-case nil
        (not (ispell-word))
      (error nil) )))
      
;; (spell-word "length") ; t
;; (spell-word "lenght") ; nil

-- 
underground experts united
https://dataswamp.org/~incal




  parent reply	other threads:[~2023-07-26 12:06 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-26  0:21 Testing validity of a word uzibalqa
2023-07-26  1:33 ` [External] : " Drew Adams
2023-07-26  1:40   ` uzibalqa
2023-07-26  2:27     ` uzibalqa
2023-07-26  4:21     ` Drew Adams
2023-07-26  2:32   ` uzibalqa
2023-07-26 12:06 ` Emanuel Berg [this message]
2023-07-26 17:08   ` uzibalqa
2023-07-26 17:45     ` Emanuel Berg
2023-07-26 19:07     ` Emanuel Berg

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87sf9ax4fb.fsf@dataswamp.org \
    --to=incal@dataswamp.org \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.