Received: by mail.netbsd.org (Postfix, from userid 605) id C93F284E20; Tue, 29 Sep 2020 17:56:57 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by mail.netbsd.org (Postfix) with ESMTP id 525AC84D9F for ; Tue, 29 Sep 2020 17:56:57 +0000 (UTC) X-Virus-Scanned: amavisd-new at netbsd.org Received: from mail.netbsd.org ([127.0.0.1]) by localhost (mail.netbsd.org [127.0.0.1]) (amavisd-new, port 10025) with ESMTP id w9POT5SCV0cG for ; Tue, 29 Sep 2020 17:56:56 +0000 (UTC) Received: from cvs.NetBSD.org (ivanova.netbsd.org [199.233.217.197]) by mail.netbsd.org (Postfix) with ESMTP id CC08E84D64 for ; Tue, 29 Sep 2020 17:56:56 +0000 (UTC) Received: by cvs.NetBSD.org (Postfix, from userid 500) id C51DFFB28; Tue, 29 Sep 2020 17:56:56 +0000 (UTC) Content-Transfer-Encoding: 7bit Content-Type: multipart/mixed; boundary="_----------=_160140221646950" MIME-Version: 1.0 Date: Tue, 29 Sep 2020 17:56:56 +0000 From: "Sean Cole" Subject: CVS commit: pkgsrc/textproc/split-thai To: pkgsrc-changes@NetBSD.org Reply-To: scole@netbsd.org X-Mailer: log_accum Message-Id: <20200929175656.C51DFFB28@cvs.NetBSD.org> Sender: pkgsrc-changes-owner@NetBSD.org List-Id: pkgsrc-changes.NetBSD.org Precedence: bulk List-Unsubscribe: This is a multi-part message in MIME format. --_----------=_160140221646950 Content-Disposition: inline Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII" Module Name: pkgsrc Committed By: scole Date: Tue Sep 29 17:56:56 UTC 2020 Modified Files: pkgsrc/textproc/split-thai: Makefile pkgsrc/textproc/split-thai/files: thai-utility.el Log Message: Update to 1.1 ------------- - in thai-utility.el update thai-word-table-in-p to use lookup-nested-alist, which is much faster and non-recursive To generate a diff of this commit: cvs rdiff -u -r1.11 -r1.12 pkgsrc/textproc/split-thai/Makefile cvs rdiff -u -r1.7 -r1.8 pkgsrc/textproc/split-thai/files/thai-utility.el Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. --_----------=_160140221646950 Content-Disposition: inline Content-Length: 1729 Content-Transfer-Encoding: binary Content-Type: text/x-diff; charset=us-ascii Modified files: Index: pkgsrc/textproc/split-thai/Makefile diff -u pkgsrc/textproc/split-thai/Makefile:1.11 pkgsrc/textproc/split-thai/Makefile:1.12 --- pkgsrc/textproc/split-thai/Makefile:1.11 Tue Sep 29 01:01:20 2020 +++ pkgsrc/textproc/split-thai/Makefile Tue Sep 29 17:56:56 2020 @@ -1,6 +1,6 @@ -# $NetBSD: Makefile,v 1.11 2020/09/29 01:01:20 scole Exp $ +# $NetBSD: Makefile,v 1.12 2020/09/29 17:56:56 scole Exp $ -PKGNAME= split-thai-1.0 +PKGNAME= split-thai-1.1 CATEGORIES= textproc MAINTAINER= pkgsrc-users@NetBSD.org COMMENT= Utilities to split UTF-8 Thai text into words Index: pkgsrc/textproc/split-thai/files/thai-utility.el diff -u pkgsrc/textproc/split-thai/files/thai-utility.el:1.7 pkgsrc/textproc/split-thai/files/thai-utility.el:1.8 --- pkgsrc/textproc/split-thai/files/thai-utility.el:1.7 Tue Sep 29 01:01:20 2020 +++ pkgsrc/textproc/split-thai/files/thai-utility.el Tue Sep 29 17:56:56 2020 @@ -43,14 +43,13 @@ uses recursion" (extract-thai-na (cdr nlist) thaistr)))))) (defun thai-word-table-in-p(thaiword) - "return t if thaiword is in 'thai-word-table, nil otherwise" - (let ((first (string-to-char (substring-no-properties thaiword 0 1))) - (elem) - (thaiwords)) - (setq elem (assq first (cdr thai-word-table))) - (setq thaiwords (extract-thai-na elem "")) - (if (and elem thaiwords (member thaiword thaiwords)) - t nil))) + "return t if thaiword is in 'thai-word-table, nil otherwise" + (let ((result + (lookup-nested-alist + thaiword thai-word-table (length thaiword) 0 t))) + (and (listp result) + (integerp (car result)) + (= 1 (car result))))) (defun thai-word-table-save(filename &optional alist) "save thai words extracted from a nested-alist table to --_----------=_160140221646950--