[prev in list] [next in list] [prev in thread] [next in thread]
List: aspell-user
Subject: Checking whether a work with a given prefix exists
From: André_A._Gomes <andremegafone () gmail ! com>
Date: 2021-08-10 17:19:20
Message-ID: 87tujxkyjr.fsf () gmail ! com
[Download RAW message or body]
Hi,
I'm wondering if Aspell has the following feature implemented.
Given a string S, can it match "^S" (interpreted as a regex) against all
entries of a given dictionary? I'm looking for a boolean as output, so
the actual list of matches is extra.
Examples: Let S be "te", and the language be english. Then it outputs
true, since it would match "test" or "television". Notice that it
wouldn't match "date" or "protein". When S is "ghb", it outputs false.
This is equivalent to having a dictionary, i.e. a list of words of a
given language, and matching using a regex. That could easily be
achieved with a file containing the dictionary and grep. But it feels
that I'm reinventing the wheel. I'd like to leverage the fact that
aspell already provides the dictionary.
The "closer" I get, with multiple obvious issues, is by using expand:
$ echo ghb/ABCDEFGHIJKLMNOPQRSTUVWXYZ | aspell -l en expand
Thank you.
--
Andr=C3=A9 A. Gomes
"Free Thought, Free World"
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic