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: Re: Let ispell use use multiple dictionaries stored in different files. Date: Sun, 8 Aug 2021 13:19:45 +0800 Message-ID: References: <874kc1i72n.fsf@zoho.eu> <87o8a8fuzv.fsf@zoho.eu> <87fsvkft1t.fsf@zoho.eu> <87bl68fs6l.fsf@zoho.eu> 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="36530"; mail-complaints-to="usenet@ciao.gmane.io" To: Emanuel Berg , help-gnu-emacs Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Sun Aug 08 07:20:58 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 1mCbF3-0009Dd-7e for geh-help-gnu-emacs@m.gmane-mx.org; Sun, 08 Aug 2021 07:20:57 +0200 Original-Received: from localhost ([::1]:50884 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mCbF2-00022f-5h for geh-help-gnu-emacs@m.gmane-mx.org; Sun, 08 Aug 2021 01:20:56 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:48026) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mCbE8-000202-OH for help-gnu-emacs@gnu.org; Sun, 08 Aug 2021 01:20:00 -0400 Original-Received: from mail-lf1-x12f.google.com ([2a00:1450:4864:20::12f]:35459) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mCbE7-0004Pf-1x for help-gnu-emacs@gnu.org; Sun, 08 Aug 2021 01:20:00 -0400 Original-Received: by mail-lf1-x12f.google.com with SMTP id c16so27016966lfc.2 for ; Sat, 07 Aug 2021 22:19:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=TrN/rkEkn4ept+/oj1RWhWeIpTxvSaWHUTg4tC27jYM=; b=NUyhBSjTYJF0E/4QBUgTKqkwdCcQ4uY9G8pUPuN75fej9PME6PYbj+oDAPyBE0E+mv BdiCQAcLSQal5/XO4wgb/XOxyy8WjZ5+CKik0vQar2p7FybupyvHz7Z/Cl73DrrMkW1g NFy8/qM3WrcGuGTGbjOaYRfHZVKzX5oQp6OTZXPXZzCTmYdR1r8XeAzZotqK+DvQUXZG Z8NpNObZsq0QUdG80HP/lbWL/18SXf86THs2BhTcIlWLAVE3lT/UVRdxSYN83aotchuy GwS9rbfofMyfK2q06YOUjSsurS0dIxiPjlK059PU64JtV3FVedcfcfPw2NXfLyGZ/4qN W1xw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=TrN/rkEkn4ept+/oj1RWhWeIpTxvSaWHUTg4tC27jYM=; b=s/UZ0wSLAhkxennMSjBPuwLHqzEkRl9MzCqNIeyb+yBXDuKLZoz6zQXs18WG3Fz2jI nYhl99zX/SbWTbtRQOG2Ik5pJoinHPpOKfRF9w6FjaSkZz6ufPavj5gQjUkJM/wR+kB0 x8nTpBAb8DdG/Afw3evHzwNoemoHtoJX4JdlFhQyoJEsDBXPIVlufR2hvX2GNLWJ33JO Xxln34HihqERXWskm3McQJgX596x2fsjdr38ksUkcZNimUPc3NDGcQoNBdBGFSzMrkwL Ui1TY1ypByUuQbRaCZH2Khpe7imKkXMwgwKk3n9xCId5kAif3x6cOv+iYkqZt71eiPil fYAw== X-Gm-Message-State: AOAM533uTVDBKQ2CWWV4cBH6hDg9EsQY9cumzbJ9ikM4gWhyBiDjSvjV sNIidbRf4S+22H0Ej7ith5lzwN4+NAdS32mHtes= X-Google-Smtp-Source: ABdhPJzTr9WmMwl4dgNfNfkSDt8OBywFVJVCf4xp3RpKtk8uDUZZNruSWxsise0Tn/R8q6BgBkmTiYbkEK3WJCfKXic= X-Received: by 2002:ac2:558e:: with SMTP id v14mr4888581lfg.75.1628399997026; Sat, 07 Aug 2021 22:19:57 -0700 (PDT) In-Reply-To: Received-SPF: pass client-ip=2a00:1450:4864:20::12f; envelope-from=hongyi.zhao@gmail.com; helo=mail-lf1-x12f.google.com X-Spam_score_int: -19 X-Spam_score: -2.0 X-Spam_bar: -- X-Spam_report: (-2.0 / 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, URIBL_SBL_A=0.1 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:132408 Archived-At: On Sun, Aug 8, 2021 at 1:08 PM Hongyi Zhao wrote: > > On Sun, Aug 8, 2021 at 12:59 PM Emanuel Berg via Users list for the > GNU Emacs text editor wrote: > > > > Hongyi Zhao wrote: > > > > > Yes, considering that the input word list files have already > > > well sorted in lexicographically order, I just want to > > > delete duplicates and leave the rest in their > > > original order. > > > > Not with two files the end result doesn't get sorted just by > > dropping the duplicates, > > > > $ echo '1\n2\n3\na\nd' > one.txt > > $ echo 'a\nb\nc\n1\n4' > abc.txt > > $ awk '!a[$0]++' one.txt abc.txt > > 1 > > 2 > > 3 > > a > > d > > b > > c > > 4 > > > > However ... > > > > $ sort -u one.txt abc.txt > > 1 > > 2 > > 3 > > 4 > > a > > b > > c > > d > > Thank you for pointing this out. I should switch to your sort method: > > $ sort -u /usr/share/dict/american-english-insane > Webster_s_Unabridged_3.txt > > american-english-insane-Webster_s_Unabridged_3 According to the discussion here [1], maybe the following is better: $ LC_ALL=C sort -u /usr/share/dict/american-english-insane Webster_s_Unabridged_3.txt > american-english-insane-Webster_s_Unabridged_3 [1] https://superuser.com/questions/631402/sort-lexicographically-in-bash Best 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