pkgsrc-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

CVS commit: pkgsrc/textproc/split-thai



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.

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@localhost
 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



Home | Main Index | Thread Index | Old Index