From 349f7710fbc9acf1581a4f324e3471c37e0510f7 Mon Sep 17 00:00:00 2001 From: patchyderm Date: Tue, 30 Jul 2019 05:02:17 +0800 Subject: [PATCH 1/2] Moved wordnet file download after the download message, updated URL. The Sourceforge wordnet download has changed to https. --- contrib/wordnet/util.lisp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/contrib/wordnet/util.lisp b/contrib/wordnet/util.lisp index f946f10..cabc759 100644 --- a/contrib/wordnet/util.lisp +++ b/contrib/wordnet/util.lisp @@ -7,19 +7,19 @@ ;;; download methods (defmethod download ((what (eql :wordnet)) - &key (url "http://sourceforge.net/projects/wnsql/files/wnsql-1.0.1/wordnet30-sqlite-1.0.1.zip/download") + &key (url "https://sourceforge.net/projects/wnsql/files/wnsql-1.0.1/wordnet30-sqlite-1.0.1.zip/download") (dir "data/")) - (let* ((dir (merge-pathnames dir (asdf:system-definition-pathname 'cl-nlp))) - (archive (download-file url dir))) + (let ((dir (merge-pathnames dir (asdf:system-definition-pathname 'cl-nlp)))) (format t "Downloading Wordnet from:~A to:~A~%It may take some time...~%" url dir) - (unwind-protect - (zip:with-zipfile (zip archive) - (zip:do-zipfile-entries (name entry zip) - (when (string= "wordnet30.sqlite" name) - (write-bin-file (merge-pathnames name dir) - (zip:zipfile-entry-contents entry))))) - (delete-file archive)))) + (let ((archive (download-file url dir))) + (unwind-protect + (zip:with-zipfile (zip archive) + (zip:do-zipfile-entries (name entry zip) + (when (string= "wordnet30.sqlite" name) + (write-bin-file (merge-pathnames name dir) + (zip:zipfile-entry-contents entry))))) + (delete-file archive))))) (defmethod download ((what (eql :wordnet-ic)) &key (url "http://nltk.org/nltk_data/packages/corpora/wordnet_ic.zip") From ddf6985e3e4d5a78516d4b5b063184276ce35ca2 Mon Sep 17 00:00:00 2001 From: patchyderm Date: Tue, 30 Jul 2019 06:23:41 +0800 Subject: [PATCH 2/2] Fixed package bug, allowing wn utilities to be called from other packages. --- contrib/wordnet/util.lisp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/wordnet/util.lisp b/contrib/wordnet/util.lisp index cabc759..5535e4d 100644 --- a/contrib/wordnet/util.lisp +++ b/contrib/wordnet/util.lisp @@ -81,7 +81,7 @@ (let (,cache-key) (loop :for ,k :in ,slots :for ,v :in ,row :do - (when-it (find (mksym ,k) ,keys) + (when-it (find (mksym ,k :package :nlp.contrib.wordnet) ,keys) (push (cons it ,v) ,cache-key))) (getset# ,cache-key *cache* (apply #'make-instance ,class