From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Hongyi Zhao Newsgroups: gmane.emacs.help Subject: Find the longest word in the word list file. Date: Wed, 11 Aug 2021 07:14:05 +0800 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="3789"; mail-complaints-to="usenet@ciao.gmane.io" To: help-gnu-emacs Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Wed Aug 11 01:14:42 2021 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mDaxF-0000pb-4x for geh-help-gnu-emacs@m.gmane-mx.org; Wed, 11 Aug 2021 01:14:41 +0200 Original-Received: from localhost ([::1]:44518 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mDaxD-0005pl-R9 for geh-help-gnu-emacs@m.gmane-mx.org; Tue, 10 Aug 2021 19:14:39 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:41836) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mDawu-0005pc-BP for help-gnu-emacs@gnu.org; Tue, 10 Aug 2021 19:14:20 -0400 Original-Received: from mail-lf1-x12b.google.com ([2a00:1450:4864:20::12b]:46998) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mDawt-0003rL-1f for help-gnu-emacs@gnu.org; Tue, 10 Aug 2021 19:14:20 -0400 Original-Received: by mail-lf1-x12b.google.com with SMTP id n17so1271476lft.13 for ; Tue, 10 Aug 2021 16:14:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=SqHx5JtIKs4Rm5eiRndLjXCrsVCmY/zFUt5WRE2sM1M=; b=SSNZLxLW0sEznvdpv78/J1A0MpxDozkvc7e4YO0qq73i8+qfgYmPrTnj42TPQaK9Xi rSJRvFXA3k0VeQSgr9L3RrAdQFYtCkeakuPfjJknje6M02mTn49a9jaSr0pBhIUkhfuQ J+blUJ5DrvDpWDW6N+Wzm+S/ff22NVSMrqCmkH+9LbXYUMlxRe6062/ZXChiuIuCxHB/ OfXipr4bppZBdQLCx73sDLWmHFED9NNbhu3ConWriuHTrBN2zmRU9Fvfbt+wzS9VPuSm 7ypW3iJthvnvhD+Da6l3fNHLY+QH2QmWM+dOmA42+JVk5H3yHMzFGa9+Ecxgc+/hBwAR gWKg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=SqHx5JtIKs4Rm5eiRndLjXCrsVCmY/zFUt5WRE2sM1M=; b=pMib3QVeGZUNdVG39EVXvrVcXBmgKUY/4/0l5wQyt84cc8+018UGpEzyJuNSX/LUVU R2/PTHFm076ot5nBqIZMZrwbJlmCnoU7jdf4v8uIY51vouaEA6uI0pgpphfuOtj0QGOL R2jv0C60oahz6lIjsanId78gBsRr8ALKpGmrNDcrewMzdauDZalN4rM3jhcoHYvRn/th hYzshFprWl00QWOZwwPD8DGsPYXaKJWveeRoZVW6aMMzqJO2X39zmHjY7uroRytddHlS wlHGGSLv0mdDOv48E59px8Gf5i+WUZlrEN7CKfTyAL+w/fwMxHJGTOOln6c2BLVMn5GE iRqg== X-Gm-Message-State: AOAM533o46ZPoveQsrHzkkeLhT3g1EXCNdw0XEfUXTDx9W+liNalXRWx +y3Jks8dtk3RPY9ht82d2ZhvpV24XNTfrKRguV1Q72YvvLsN7JVixFY= X-Google-Smtp-Source: ABdhPJzw85s0J7rVQXnUA5WlumMVFti4neE7VUD9G4w70WIE1AMOsIMVD5iRlCzU5Skj5CuFJnjTvzICPM+sazxU3A0= X-Received: by 2002:ac2:46fb:: with SMTP id q27mr5469454lfo.466.1628637256920; Tue, 10 Aug 2021 16:14:16 -0700 (PDT) Received-SPF: pass client-ip=2a00:1450:4864:20::12b; envelope-from=hongyi.zhao@gmail.com; helo=mail-lf1-x12b.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.io gmane.emacs.help:132440 Archived-At: I have an English word list file that stores words in a one-word-per-line format. Now I want to find the longest word in the word list file. For example, I can use standard UNIX tools to accomplish this with the following simple commands: $ awk '$0 ~ /^[[:alpha:]]+$/ { print $0, length($0) }' american-english-exhaustive | \ sort -k2n | tail -1 Llanfairpwllgwyngyllgogerychwyrndrobwllllantysiliogogogoch 58 But in Emacs, what is the elisp implementation for the above task? Regards -- Assoc. Prof. Hongyi Zhao Theory and Simulation of Materials Hebei Vocational University of Technology and Engineering No. 473, Quannan West Street, Xindu District, Xingtai, Hebei province