1

I am trying to run the repository from the following link:
https://github.com/JafferWilson/test-program

I am getting this error:

sbcl --script paraphrasing.lisp Unhandled SB-KERNEL:SIMPLE-PACKAGE-ERROR in thread #<SB-THREAD:THREAD "main thread" RUNNING {100399C6D3}>: The name "USER" does not designate any package. Backtrace for: #<SB-THREAD:THREAD "main thread" RUNNING {100399C6D3}> 0: ((LAMBDA NIL :IN SB-DEBUG::FUNCALL-WITH-DEBUG-IO-SYNTAX)) 1: (SB-IMPL::CALL-WITH-SANE-IO-SYNTAX #<CLOSURE (LAMBDA NIL :IN SB-DEBUG::FUNCALL-WITH-DEBUG-IO-SYNTAX) {10039E3C1B}>) 2: (SB-IMPL::%WITH-STANDARD-IO-SYNTAX #<CLOSURE (LAMBDA NIL :IN SB-DEBUG::FUNCALL-WITH-DEBUG-IO-SYNTAX) {10039E3BEB}>) 3: (PRINT-BACKTRACE :STREAM #<SB-SYS:FD-STREAM for "standard error" {10039A22B3}> :START 0 :FROM :INTERRUPTED-FRAME :COUNT NIL :PRINT-THREAD T :PRINT-FRAME-SOURCE NIL :METHOD-FRAME-STYLE NIL) 4: (SB-DEBUG::DEBUGGER-DISABLED-HOOK #<SB-KERNEL:SIMPLE-PACKAGE-ERROR "The name ~S does not designate any package." {10039E1643}> #<unavailable argument>) 5: (SB-DEBUG::RUN-HOOK *INVOKE-DEBUGGER-HOOK* #<SB-KERNEL:SIMPLE-PACKAGE-ERROR "The name ~S does not designate any package." {10039E1643}>) 6: (INVOKE-DEBUGGER #<SB-KERNEL:SIMPLE-PACKAGE-ERROR "The name ~S does not designate any package." {10039E1643}>) 7: (ERROR SB-KERNEL:SIMPLE-PACKAGE-ERROR :PACKAGE "USER" :FORMAT-CONTROL "The name ~S does not designate any package." :FORMAT-ARGUMENTS ("USER")) 8: (SB-INT:%FIND-PACKAGE-OR-LOSE "USER") 9: (SB-INT:FIND-UNDELETED-PACKAGE-OR-LOSE "USER") 10: ((LAMBDA NIL :IN "/home/aims/paraphrasing/paraphrasing.lisp")) 11: (SB-INT:SIMPLE-EVAL-IN-LEXENV (SETQ *PACKAGE* (SB-INT:FIND-UNDELETED-PACKAGE-OR-LOSE "USER")) #<NULL-LEXENV>) 12: (SB-INT:SIMPLE-EVAL-IN-LEXENV (IN-PACKAGE "USER") #<NULL-LEXENV>) 13: (EVAL-TLF (IN-PACKAGE "USER") 0 NIL) 14: ((LABELS SB-FASL::EVAL-FORM :IN SB-INT:LOAD-AS-SOURCE) (IN-PACKAGE "USER") 0) 15: ((LAMBDA (SB-KERNEL:FORM &KEY :CURRENT-INDEX &ALLOW-OTHER-KEYS) :IN SB-INT:LOAD-AS-SOURCE) (IN-PACKAGE "USER") :CURRENT-INDEX 0) 16: (SB-C::%DO-FORMS-FROM-INFO #<CLOSURE (LAMBDA (SB-KERNEL:FORM &KEY :CURRENT-INDEX &ALLOW-OTHER-KEYS) :IN SB-INT:LOAD-AS-SOURCE) {10039A7ECB}> #<SB-C::SOURCE-INFO {10039A7E83}> SB-C::INPUT-ERROR-IN-LOAD) 17: (SB-INT:LOAD-AS-SOURCE #<SB-SYS:FD-STREAM for "file /home/aims/paraphrasing/paraphrasing.lisp" {10039A4703}> :VERBOSE NIL :PRINT NIL :CONTEXT "loading") 18: ((FLET SB-FASL::LOAD-STREAM :IN LOAD) #<SB-SYS:FD-STREAM for "file /home/aims/paraphrasing/paraphrasing.lisp" {10039A4703}> NIL) 19: (LOAD #<SB-SYS:FD-STREAM for "file /home/aims/paraphrasing/paraphrasing.lisp" {10039A4703}> :VERBOSE NIL :PRINT NIL :IF-DOES-NOT-EXIST T :EXTERNAL-FORMAT :DEFAULT) 20: ((FLET SB-IMPL::LOAD-SCRIPT :IN SB-IMPL::PROCESS-SCRIPT) #<SB-SYS:FD-STREAM for "file /home/aims/paraphrasing/paraphrasing.lisp" {10039A4703}>) 21: ((FLET #:WITHOUT-INTERRUPTS-BODY-146 :IN SB-IMPL::PROCESS-SCRIPT)) 22: (SB-IMPL::PROCESS-SCRIPT "paraphrasing.lisp") 23: (SB-IMPL::TOPLEVEL-INIT) 24: ((FLET #:WITHOUT-INTERRUPTS-BODY-82 :IN SAVE-LISP-AND-DIE)) 25: ((LABELS SB-IMPL::RESTART-LISP :IN SAVE-LISP-AND-DIE)) unhandled condition in --disable-debugger mode, quitting 

Kindly, help me to resolve this so the program runs effectively.

6
  • Replace the obsolete name "USER" with "CL-USER". Commented Aug 3, 2017 at 5:05
  • After replacing with your suggestion: I am getting the error: Lock on package SB-EXT violated when defining WORD as a structure while in package COMMON-LISP-USER. See also: The SBCL Manual, Node "Package Locks" Commented Aug 3, 2017 at 5:15
  • I am running the command as: sbcl --script paraphrase.lisp Commented Aug 3, 2017 at 5:16
  • 1
    That error means you're defining a struct named WORD, which conflicts with a symbol exported from the locked package SB-EXT. The CL-USER package uses SB-EXT by default in SBCL. You should define your own package that doesn't use SB-EXT to avoid this. Commented Aug 3, 2017 at 7:47
  • To expand on what @jkiiski said, try sbcl --eval '(defpackage :user (:use :cl))' --script paraphrase.lisp, without modifying the code. Commented Aug 3, 2017 at 8:19

1 Answer 1

5

For SBCL:

Create a package and use only the package COMMON-LISP:

(defpackage "PARAPHRASING" (:use "COMMON-LISP")) (in-package "PARAPHRASING") 

Replace all DEFCONSTANT defining lists with DEFPARAMETER

(defparameter +bad-single-pos-paraphrasings+ (mapcar #'intern '("TO" "DT" "CC" "IN" "WDT" "POS" "PRP"))) (defparameter +input-paren-types+ (list (list "[[" (intern "NN")) (list "((" (intern "VB")))) ;; Stuff with no alphabetic chars is ignored in any case (defparameter +auxiliaries+ (mapcar #'intern '("DT" "IN" "TO"))) ;; Lengths taken for rules (defparameter +context-lens+ '(1)) 

Make sure the return value of NREVERSE is used

(defun extract-paraphrases1 (pair rule) (labels (;; Find all positions where prfx is in seq. (find-prefix-positions (prfx seq) (if (null (first prfx)) ;; Must be at the beginning. (and (pos-match-prefix (rest prfx) seq) (list -1)) (pos-sub-positions prfx seq))) ;; Find all positions where sffx is in seq - after some point. (find-suffix-positions (skip sffx seq) (let ((lst (nthcdr skip seq))) (if (null (first sffx)) ;; a trick - nreverse both lists, not expensive (let* ((slen (length (rest sffx))) (sffx (nreverse (rest sffx))) (lst (nreverse lst)) (m? (pos-match-prefix sffx lst))) ;; restore things (setf sffx (nreverse sffx)) ; <- use the result (setf lst (nreverse lst)) ; <- use the result ... 

INTERN

All the calls to INTERN should use the package name "PARAPHRASING" as a second parameter. This way the symbols are always created in the correct package.

Use

* (paraphrasing::co-train "20000leagues-tagged-pairs-roots.txt") Reading input... Done, 6275 sentences read. ========== Iteration #1/10 ========== Learning context rules... ...6250 left ...6000 left ... 
Sign up to request clarification or add additional context in comments.

5 Comments

I have done the necessary changes but I could see the output as you have mentioned. I get nothing after I ran sbcl --script paraphrase.lisp did I miss anything
The file does nothing. You need to call the function (see my example) somewhere. For example you could add it to the end of the source code using the correct pathname for your data file.
using "sbcl --script ..." for development purposes is not that useful. Common Lisp development works best interactively, not by using it as a script runner. Once the code is working you can make sure that you can call it as a script, but that is the second step.
I don't know whether it is right or not, but can you please help me. Actually I am trying to use this code in my project where this will generate the paraphrase of the input text. can you please guide, how I can change the code so that it will generate the output of the newer text. Please.
Sir, Can you help me with that, please?

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.