Browse Source

Corrections.

master
Silas Vedder 3 years ago
parent
commit
80fc69a8ec
  1. 12
      clog.lisp
  2. 3
      lift-search.lisp
  3. 16
      package.lisp
  4. 4
      search.lisp
  5. 4
      verse.lisp

12
clog.lisp

@ -24,7 +24,7 @@
(create-p div :content (ergebnis/se (create-p div :content (ergebnis/se
(length results))) (length results)))
(mapc (lambda (verse) (mapc (lambda (verse)
(v:verse-to-clog verse div :translation d::*translation*)) (v:verse-to-clog verse div :translation d:*translation*))
results))) results)))
(defun searcher (window) (defun searcher (window)
@ -64,25 +64,27 @@
(defun load-book (canvas book) (defun load-book (canvas book)
(let* ((win (window-content (let* ((win (window-content
(create-gui-window canvas :title (format nil "~A" (create-gui-window canvas :title (format nil "~A: ~A"
d:*translation*
book) book)
:height 400 :height 400
:width 650))) :width 650)))
(div (create-div win))) (div (create-div win)))
(mapc (lambda (verse) (mapc (lambda (verse)
(v:verse-to-clog verse div :translation d::*translation*)) (v:verse-to-clog verse div :translation d:*translation*))
(s:find-book d:*bible* book)))) (s:find-book d:*bible* book))))
(defun load-chapter (canvas book chapter) (defun load-chapter (canvas book chapter)
(let* ((win (window-content (let* ((win (window-content
(create-gui-window canvas :title (format nil "~A ~A" (create-gui-window canvas :title (format nil "~A: ~A ~A"
d:*translation*
book book
chapter) chapter)
:height 400 :height 400
:width 650))) :width 650)))
(div (create-div win))) (div (create-div win)))
(mapc (lambda (verse) (mapc (lambda (verse)
(v:verse-to-clog verse div :translation d::*translation*)) (v:verse-to-clog verse div :translation d:*translation*))
(s:find-chapter (s:find-book d:*bible* book) chapter)))) (s:find-chapter (s:find-book d:*bible* book) chapter))))
(defun get-chapter (window body) (defun get-chapter (window body)

3
lift-search.lisp

@ -5,8 +5,7 @@
(defun frequent-words () (str:words "der die das dir mir wir ihr sie sein mein dein euer unser dem den in zu und")) (defun frequent-words () (str:words "der die das dir mir wir ihr sie sein mein dein euer unser dem den in zu und"))
(defun lift-search (search-result) (defun lift-search (search-result)
(comb (diff-verses (mapcar #'v:text (comb (diff-verses (mapcar #'v:get-text search-result))
search-result))
(length search-result))) (length search-result)))
(defun count-words (words) (defun count-words (words)

16
package.lisp

@ -12,7 +12,8 @@
vnumber vnumber
text text
notes notes
translations)) translations
get-text))
(defpackage #:cl-bible.search (defpackage #:cl-bible.search
(:use #:cl) (:use #:cl)
@ -21,12 +22,6 @@
find-book find-book
find-chapter)) find-chapter))
(defpackage #:cl-bible.lift-search
(:use #:cl)
(:local-nicknames (#:s #:cl-bible.search)
(#:v #:cl-bible.verse))
(:export lift-search))
(defpackage #:cl-bible.data (defpackage #:cl-bible.data
(:use #:cl) (:use #:cl)
(:local-nicknames (#:s #:cl-bible.search) (:local-nicknames (#:s #:cl-bible.search)
@ -37,6 +32,13 @@
persist persist
load-bibles)) load-bibles))
(defpackage #:cl-bible.lift-search
(:use #:cl)
(:local-nicknames (#:s #:cl-bible.search)
(#:v #:cl-bible.verse)
(#:d #:cl-bible.data))
(:export lift-search))
(defpackage #:cl-bible.clog (defpackage #:cl-bible.clog
(:use #:cl #:clog #:clog-gui) (:use #:cl #:clog #:clog-gui)
(:local-nicknames (#:l #:cl-bible.lift-search) (:local-nicknames (#:l #:cl-bible.lift-search)

4
search.lisp

@ -4,9 +4,7 @@
(defun find-in-bible (bible phrase) (defun find-in-bible (bible phrase)
(remove-if-not (lambda (verse) (search phrase (remove-if-not (lambda (verse) (search phrase
(cdr (v:get-text verse)))
(assoc cl-bible.data:*translation*
(v:translations verse)))))
bible)) bible))
(defun find-book (bible book) (defun find-book (bible book)

4
verse.lisp

@ -49,6 +49,10 @@
separator separator
(cdr (assoc translation (translations verse))))) (cdr (assoc translation (translations verse)))))
(defgeneric get-text (verse))
(defmethod get-text ((verse verse))
(cdr (assoc cl-bible.data:*translation* (translations verse))))
(defmethod show-notes ((verse verse) (parent clog:clog-obj)) (defmethod show-notes ((verse verse) (parent clog:clog-obj))
(let* ((win (clog-gui:create-gui-window parent (let* ((win (clog-gui:create-gui-window parent
:title "Notes" :title "Notes"

Loading…
Cancel
Save