Hi,
A problem with user guides is that users express their problem in very
specific ways but user guides generaly give general answers. It is why FAQ
and direct questions are far more better for users.
So i thought about filling the gap : giving to a lisp program the general
answers but allowing users to query it with specific questions. Below, i
wrote a test case of what i mean.
Do you have an idea of how to implement it or further suggestions ?
(def-how-to-get ((a historic) (a channel))
'((click-on (the channel) in (the panel :channel-list))
(click-on (the button :history) in (the panel :analysis))
(select (name (the historic)) in (the combo-box :filter) in (the
panel :analysis)) ))
;;; test case
(how-to-get (the historic :aSpecificHistoricName) (a channel))
=>
((click-on (the channel) in (the panel :channel-list))
(click-on (the button :history) in (the panel :analysis))
(select :aSpecificHistoricName in (the combo-box :filter) in (the panel
:analysis)) )
--
___________________________________________________________
Christophe Turle.
sava preview http://perso.wanadoo.fr/turle/lisp/sava.html
(format nil ···@~a.~a" 'c.turle 'wanadoo 'fr)
"Christophe Turle" <······@nospam.com> writes:
> Hi,
>
> A problem with user guides is that users express their problem in very
> specific ways but user guides generaly give general answers. It is why FAQ
> and direct questions are far more better for users.
>
> So i thought about filling the gap : giving to a lisp program the general
> answers but allowing users to query it with specific questions. Below, i
> wrote a test case of what i mean.
>
> Do you have an idea of how to implement it or further suggestions ?
You might want to check out
<http://www.alicebot.org/>
and
<http://www.pandorabots.com/>
Annoyingly, although the Pandorabots web site is running a version of
AIML written in Common Lisp (described as "the last implementation
anyone will need") the code, written by the folks at Franz, hasn't
been released--as I understand it--because the AIML part and the web
hosting part are too intertwingled. The Python version is fairly clean
and it might be a fun project to translate it to Common Lisp. And
since the AIML "language" with which you program the bots is XML-based
it should be easy to make a "native-mode" Common Lisp program that
uses s-exprs instead of XML and get some wins when it comes to
authoring bots.
-Peter
--
Peter Seibel ·····@javamonkey.com
Lisp is the red pill. -- John Fraser, comp.lang.lisp
>> Hi,
>>
>> A problem with user guides is that users express their problem in very
>> specific ways but user guides generaly give general answers. It is why
>> FAQ
>> and direct questions are far more better for users.
>>
>> So i thought about filling the gap : giving to a lisp program the general
>> answers but allowing users to query it with specific questions. Below, i
>> wrote a test case of what i mean.
>>
>> Do you have an idea of how to implement it or further suggestions ?
>
> You might want to check out
>
> <http://www.alicebot.org/>
>
> and
>
> <http://www.pandorabots.com/>
Not sure it maps my requirements. And as you said, to do it in lisp, i have
to begin from scratch. Is AIML easily extensible ? Too many questions for
now, but thx for the links.
In the meantime, i wrote a solution of the test case :
(defmacro def-faq (name (&rest types) response)
(let ((args (gen-n-sym (length types)))
(fct-name (intern (string+ (symbol-name name) "-FCT"))) )
`(progn
(defmacro ,name ,args
`(,,fct-name ,,@(mapcar (lambda(x) `(list 'quote ,x)) args)) )
(defun ,fct-name ,args
(reduce-sentence
(args-replace (list ,@args) ',(mapcar #'template-arg-ref types)
,response) )))))
(defun reduce-sentence (s)
(mapcar (lambda(x)
(cond ((and (listp x) (= (length x) 2)
(eql (first x) 'name)
(let ((x2 (second x)))
(and (listp x2) (= (length x2) 3) (eql (first x2)
'the)) ))
(third (second x)) )
((listp x) (reduce-sentence x))
(t x) ))
s ))
(defun args-replace (args args-t s)
(if (or (null args) (null args-t))
s
(args-replace (rest args) (rest args-t) (arg-replace (first args)
(first args-t) s)) ))
(defun arg-replace (a t-a s)
(if (arg-class-p a)
s
(subst a t-a s :test #'equal) ))
(defun template-arg-ref (a)
(list 'the (second a)) )
(defun arg-class-p (a)
(eql (first a) 'a) )
(defun gen-n-sym (n)
(if (> n 0) (cons (gensym) (gen-n-sym (1- n)))
'() ))
(defun string+ (&rest args)
(apply #'concatenate 'string args) )
;;; -------------------- test -----------------------
(def-faq how-to-get ((a historic) (a channel))
'((click-on (the channel) in (the panel :channel-list))
(click-on (the button :history) in (the panel :analysis))
(select (name (the historic)) in (the combo-box :filter) in (the
panel :analysis)) ))
(how-to-get (the historic :a-specific-historic-name) (a channel))
=>
((click-on (the channel) in (the panel :channel-list))
(click-on (the button :history) in (the panel :analysis))
(select :a-specific-historic-name in (the combo-box :filter) in (the panel
:analysis)) )
(how-to-get (a historic) (a channel))
=>
((click-on (the channel) in (the panel :channel-list))
(click-on (the button :history) in (the panel :analysis))
(select (the historic) in (the combo-box :filter) in (the panel
:analysis)) )
comments ?
--
___________________________________________________________
Christophe Turle.
sava preview http://perso.wanadoo.fr/turle/lisp/sava.html
(format nil ···@~a.~a" 'c.turle 'wanadoo 'fr)