-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest-sbl.lisp
executable file
·62 lines (42 loc) · 1.74 KB
/
test-sbl.lisp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#!/usr/bin/sbcl --noinform
;; If run from command line, the following if-test will succeed
;;(let ((quicklisp-init (merge-pathnames "quicklisp/setup.lisp"
;; (user-homedir-pathname))))
;; (when (probe-file quicklisp-init)
;; (load quicklisp-init)))
(defparameter db-file "~/english/books/full_english(utf-8).txt")
(let ((quicklisp-init (merge-pathnames "quicklisp/setup.lisp"
(user-homedir-pathname))))
(when (probe-file quicklisp-init)
(load quicklisp-init)))
(ql:quickload :cl-ppcre)
(defparameter result-ppcre (cl-ppcre:scan "(a)*b" "xaaabd"))
;;; data for dsl.
;;(defparameter data-dsl '(
;; ("word"
;; ("label" . "
(format t "jopa!!!!!~d" result-ppcre)
;; (cl-ppcre:scan "(\\w+)\\W*\\[.*\\]" "abolitionist [ bə liʃ(ə)nist] n аболиционист")
;;
(defun get-border-entity (string)
(format t "~d" (cl-ppcre:scan "(\\w+)\\W*\\[.*\\]" string))
(print string)
(print ""))
;; (get-border-entity "abolitionist [ bə liʃ(ə)nist] n аболиционист")
(defun next-entity (stream fn)
(let ((current-string (read-line stream)))
(funcall fn current-string)))
(with-open-file (stream db-file)
(dotimes (x 100)
(next-entity (stream #'get-border-entity))
(format t "~a~% ~d" (read-line stream) (1+ x))))
;;(dotimes (x 20)
;; (dotimes (y 20)
;; (format t "~3d " (* (1+ x) (1+ y))))
;; (format t "~%"))
;; (open "/some/file/name.txt" :direction :output :if-exists :supersede)
(if (> (length sb-ext:*posix-argv*) 1)
;;(format t "24jaoa")
(format t "~{ ~d~}" (list 2 3 4))
;; Code that is executed from the command line only goes here
)