From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id OQVWBDEONWdP0TAAWB0awg (envelope-from ) for ; Wed, 13 Nov 2024 15:38:09 -0500 Authentication-Results: simark.ca; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=PHL5vKVd; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id E3E831E170; Wed, 13 Nov 2024 15:38:08 -0500 (EST) X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-6.4 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham autolearn_force=no version=4.0.0 Received: from server2.sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 38CC11E15F for ; Wed, 13 Nov 2024 15:38:08 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 124A03858D28 for ; Wed, 13 Nov 2024 20:38:07 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 124A03858D28 Authentication-Results: sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=PHL5vKVd Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTP id D17B53858D28 for ; Wed, 13 Nov 2024 20:37:30 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org D17B53858D28 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org D17B53858D28 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1731530250; cv=none; b=ELAagEeBu+jDsprwvgnbCPHSE8kzsMOG789b83/fOW8makR0Xd+uaBzW/feuR4738JupZiL/NZYtjY3wuvuylOXAlZHoU/f59YkPJOibyTp4hHRILI905zGIHSopLd/+KZTTYV2wn67LeoBoYVnzyGrgFZlehoTwj3OOU6ZSCTA= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1731530250; c=relaxed/simple; bh=RZHjMPHLtvE531j6NfH5OFnMbo77c3ajqU4WKy0uB5M=; h=DKIM-Signature:Date:From:To:Subject:Message-ID:MIME-Version; b=D+U4g0Slb20Gf1XLOQ8MDVFCfQu8w87cKJzF3oxuKbmlXCMyKIWVfOQlcb6LKJdLOol0vSFj+4Rxy9290xF9xHpOCyUTKkiOvdTbCn4u/i0d3RP1CY2DzHPMOGY4z63sq8/mQNyrcIlx6k1eJbwxr+k3zdgp75AR6xdHsg7EVHY= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D17B53858D28 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1731530250; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ympp908xjiiwW4uyROMGALOpR3JdtMWT31JFMYIiQ7Q=; b=PHL5vKVd2vJp87oWD8ZN171/POe8c2+2y+nr9fIKFI7NNgiV/ldqf4+IopFY8p6Yby0O7J elCJNd/PV/M20IKua+FoSij494FArwLKbrfh+8Sm1gNcoltjeDxi1U3s0ep0mi1s4JRnci wYIJbCTHlSOS39dyxIrNS5iiw4byKxY= Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-14-8Aj0QIlIPhOapxCWFtG6FQ-1; Wed, 13 Nov 2024 15:37:29 -0500 X-MC-Unique: 8Aj0QIlIPhOapxCWFtG6FQ-1 X-Mimecast-MFC-AGG-ID: 8Aj0QIlIPhOapxCWFtG6FQ Received: from mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.15]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 4EF9E1955F3A; Wed, 13 Nov 2024 20:37:28 +0000 (UTC) Received: from f40-zbm-amd (unknown [10.22.80.92]) by mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 2CF5A1944CC9; Wed, 13 Nov 2024 20:37:26 +0000 (UTC) Date: Wed, 13 Nov 2024 13:37:22 -0700 From: Kevin Buettner To: Tom de Vries Cc: gdb-patches@sourceware.org Subject: Re: [PATCH] [gdb/contrib] Handle capitalized words in spellcheck.sh Message-ID: <20241113133722.52c198f4@f40-zbm-amd> In-Reply-To: <20241113010852.13952-1-tdevries@suse.de> References: <20241113010852.13952-1-tdevries@suse.de> Organization: Red Hat MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.15 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: nzHSo9v0GsY-l_giRQgYQL1huNLnkfeAJDawFfxlurQ_1731530248 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces~public-inbox=simark.ca@sourceware.org On Wed, 13 Nov 2024 02:08:52 +0100 Tom de Vries 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