2016-04-14 23 views

cevap

1

üzerinde bulunmaktadır bir başlangıç:

CLIPS> 
(deftemplate sentence 
    (multislot text) 
    (slot deleted_count (default 0))) 
CLIPS> 
(defrule delete 
    ?f <- (sentence (text $?b ?word&:(< (str-length ?word) 4) $?e) 
        (deleted_count ?count)) 
    => 
    (modify ?f (text ?b ?e) (deleted_count (+ 1 ?count)))) 
CLIPS> (assert (sentence (text the quick brown fox jumped over the lazy dogs))) 
<Fact-1> 
CLIPS> (run) 
CLIPS> (facts) 
f-0  (initial-fact) 
f-4  (sentence (text quick brown jumped over lazy dogs) (deleted_count 3)) 
For a total of 2 facts. 
CLIPS> 

mevcut belgeleri okumak ve yaptık size göstermek için bir azından belirteç çaba yapmalıdır Yığın taşması sorular sorarak Sorunu çözmek için bir çaba.

+0

thx! ben böyle bir şey yapmaya çalışıyordu '(defmethod Ichi \t() \t (bağlama? girişi()) "çekiç dril vidasını gördü" $ patlayabilir \t (? bağlayan \t (döngü-için-) "" sonuçlanabilir saymak (? i 1 4) do \t \t (bağlama? kelime (n'inci $? i? girişi)) \t \t (if (<(uzunluk $? kelime) 4) daha sonra \t \t \t (str-cat ? kelime? sonuç) \t \t) \t \t \t (çıktısı t? Kelime crlf) \t) \t? neden) ' – IchigoWalker

İlgili konular