mirror of
https://codeberg.org/cage/tinmop/
synced 2025-02-02 04:36:43 +01:00
- added more terms when searching gempub metadata ('<', '>', '<=', '<=', '=' '!=').
This commit is contained in:
parent
baf3f4c1ea
commit
e763158a8b
@ -127,12 +127,23 @@
|
||||
(defrule spaces (+ blank)
|
||||
(:constant nil))
|
||||
|
||||
(defrule column (or "title"
|
||||
(defrule publish-date-alias "publishedDate"
|
||||
(:constant "\"published-date\""))
|
||||
|
||||
(defrule revision-date-alias "revisionDate"
|
||||
(:constant "\"revision-date\""))
|
||||
|
||||
(defrule column-alias (or publish-date-alias
|
||||
revision-date-alias))
|
||||
|
||||
(defrule column (or column-alias
|
||||
"title"
|
||||
"author"
|
||||
"language"
|
||||
"description"
|
||||
"publish-date"
|
||||
"revision-date"
|
||||
"published"
|
||||
"copyright")
|
||||
(:text t))
|
||||
|
||||
@ -141,7 +152,13 @@
|
||||
|
||||
(defrule term (or and-where
|
||||
or-where
|
||||
like)
|
||||
like
|
||||
=-term
|
||||
!=-term
|
||||
<-term
|
||||
>-term
|
||||
<=-term
|
||||
>=-term)
|
||||
(:function (lambda (a) (join-with-strings a " "))))
|
||||
|
||||
(defrule like (and column spaces "like" spaces column-value)
|
||||
@ -150,6 +167,42 @@
|
||||
(first a)
|
||||
(string-trim '(#\") (fifth a))))))
|
||||
|
||||
(defrule =-term (and column spaces "=" spaces column-value)
|
||||
(:function (lambda (a) (format nil
|
||||
"~a = ~a"
|
||||
(first a)
|
||||
(fifth a)))))
|
||||
|
||||
(defrule <-term (and column spaces "<" spaces column-value)
|
||||
(:function (lambda (a) (format nil
|
||||
"~a < ~a"
|
||||
(first a)
|
||||
(fifth a)))))
|
||||
|
||||
(defrule >-term (and column spaces ">" spaces column-value)
|
||||
(:function (lambda (a) (format nil
|
||||
"~a > ~a"
|
||||
(first a)
|
||||
(fifth a)))))
|
||||
|
||||
(defrule <=-term (and column spaces "<=" spaces column-value)
|
||||
(:function (lambda (a) (format nil
|
||||
"~a <= ~a"
|
||||
(first a)
|
||||
(fifth a)))))
|
||||
|
||||
(defrule >=-term (and column spaces ">=" spaces column-value)
|
||||
(:function (lambda (a) (format nil
|
||||
"~a >= ~a"
|
||||
(first a)
|
||||
(fifth a)))))
|
||||
|
||||
(defrule !=-term (and column spaces "!=" spaces column-value)
|
||||
(:function (lambda (a) (format nil
|
||||
"~a != ~a"
|
||||
(first a)
|
||||
(fifth a)))))
|
||||
|
||||
(defrule and-where (and term spaces "and" spaces term))
|
||||
|
||||
(defrule or-where (and term spaces "or" spaces term))
|
||||
|
Loading…
x
Reference in New Issue
Block a user