From: Tom de Vries <tdevries@suse.de>
To: Kevin Buettner <kevinb@redhat.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH] [gdb/contrib] Handle capitalized words in spellcheck.sh
Date: Wed, 13 Nov 2024 22:38:34 +0100 [thread overview]
Message-ID: <ee9ccf3d-e240-4659-9c86-185ffe0c01c6@suse.de> (raw)
In-Reply-To: <20241113133722.52c198f4@f40-zbm-amd>
On 11/13/24 21:37, Kevin Buettner wrote:
> On Wed, 13 Nov 2024 02:08:52 +0100
> Tom de Vries <tdevries@suse.de> wrote:
>
>> The dictionary contains a few entries with capital letters:
>> ...
>> $ grep -E '[A-Z]' .git/wikipedia-common-misspellings.txt | wc -l
>> 143
>> ...
>> but they don't look too interesting in the gdb context (for instance,
>> Habsbourg->Habsburg), so filter them out.
>>
>> That leaves us with entries looking only like "foobat->foobar", so add
>> handling of capitalized words, such that we also rewrite "Foobat" to "Foobar".
>
> ...
>
> - pat=$(grep_join "${words[@]}")
> + declare -a re_words
> + mapfile -t re_words \
> + < <(for f in "${words[@]}"; do
> + echo "$f"
> + done \
> + | sed "s/^\(.\)/[\u\1\1]/")
> +
> + pat=$(grep_join "${re_words[@]}")
>
> It took me a while to puzzle out that process substitution is being
> used to provide input to the mapfile command, but once I figured that
> out, it made sense to me.
>
> Approved-by: Kevin Buettner <kevinb@redhat.com>
Thanks for the review, pushed.
- Tom
prev parent reply other threads:[~2024-11-13 21:38 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-13 1:08 Tom de Vries
2024-11-13 20:37 ` Kevin Buettner
2024-11-13 21:38 ` Tom de Vries [this message]
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=ee9ccf3d-e240-4659-9c86-185ffe0c01c6@suse.de \
--to=tdevries@suse.de \
--cc=gdb-patches@sourceware.org \
--cc=kevinb@redhat.com \
/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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox