OverviewFilesCommitsIssuesDocsReleasesPeers

opencog-agents commits / 6cda606

Start trying to count
6cda606ff9e3e439b7e57880ac68215fa61efacf
by Linas Vepštas <linasvepstas@gmail.com> · 2024-04-06T14:49:10.000Z

Changed files (1) +23 -9

scm/pair-agent/count-agent.scm +23 -9
……@@ -25,19 +25,33 @@
2525;
2626(define (obs-txt PLAIN-TEXT)
2727
28 (define parser
28 (define (incr-cnt edge)
29 (SetValue edge (Predicate "count")
30 (Plus (Number 0 0 1)
31 (Cond (FloatValueOf edge (Predicate "count"))
32 (FloatValueOf edge (Predicate "count"))
33 (FloatValueOf (Number 0 0 0))))))
34
35 (define parseli
2936 (PureExecLink (LgParseBonds (Phrase PLAIN-TEXT) DICT NUML)))
30 (define filt
37 (define filty
3138 (Filter
32 (Lambda
33 (Variable "$x")
39 (Rule
40 ; Type decl
41 (Glob "$x")
42 ; Match clause - one per parse.
3443 (LinkSignature
35 (Type 'LinkValue)
36 (Type 'LinkValue)
37 (Variable "$x")))
38 parser))
44 (Type 'LinkValue) ; the wrapper for the pair
45 (Type 'LinkValue) ; the word-list
46 (LinkSignature ; the edge-list
47 (Type 'LinkValue) ; edge-list wrapper
48 (Glob "$x"))) ; all of the edges
49 ; Rewrite
50 (incr-cnt (Glob "$x"))
51 )
52 parseli))
3953
40 (define parses (cog-execute! filt))
54 (define parses (cog-execute! filty))
4155 parses
4256)
4357