# HG changeset patch # User Jamie Forth # Date 1301344837 -3600 # Node ID 8e5f306b7e47fae6d9d702041717b8dcd60a9a60 # Parent f5836b2bf3342fa80b8d8a29fc7cd10fbf7870f0 add 'onset-within' generics - does Allen say anything about this? diff -r f5836b2bf334 -r 8e5f306b7e47 base/generics.lisp --- a/base/generics.lisp Sat Mar 19 18:51:23 2011 +0000 +++ b/base/generics.lisp Mon Mar 28 21:40:37 2011 +0100 @@ -341,6 +341,10 @@ (defgeneric starts (object1 object2)) (defgeneric ends (object1 object2)) +;;; Does Allen cover this? Like during, except don't consider cut-off. +(defgeneric onset-within (object1 object2)) +(defgeneric onset-within-fuzzy (object1 object2 period)) + ;;; and extensions thereof ... (defgeneric subinterval (object1 object2) diff -r f5836b2bf334 -r 8e5f306b7e47 base/methods.lisp --- a/base/methods.lisp Sat Mar 19 18:51:23 2011 +0000 +++ b/base/methods.lisp Mon Mar 28 21:40:37 2011 +0100 @@ -423,6 +423,18 @@ (object2 anchored-period)) (time= (cut-off object1) (cut-off object2))) +;; Does Allen cover this? Anyway, they are useful for me -JF. +(defmethod onset-within ((object1 moment) + (object2 standard-anchored-period)) + (and (time>= object1 object2) + (time<= object1 (cut-off object2)))) + +(defmethod onset-within-fuzzy ((object1 moment) + (object2 standard-anchored-period) + (period standard-period)) + (and (time>= object1 (time- (onset object2) period)) + (time<= object1 (time- (cut-off object2) period)))) + ;; ...and (defmethod period= ((object1 anchored-period) diff -r f5836b2bf334 -r 8e5f306b7e47 base/package.lisp --- a/base/package.lisp Sat Mar 19 18:51:23 2011 +0000 +++ b/base/package.lisp Mon Mar 28 21:40:37 2011 +0100 @@ -116,6 +116,8 @@ #:during #:starts #:ends + #:onset-within + #:onset-within-fuzzy #:subinterval #:disjoint #:period=