OverviewFilesCommitsIssuesDocsReleasesPeers

opencog-agents commits / 0aa70cd

Get ready to count words, too
0aa70cd3fafda0100b39833b7d53738f94a67626
by Linas Vepštas <linasvepstas@gmail.com> · 2024-05-03T14:23:27.000Z

Changed files (1) +10 -10

scm/pair-agent/count-agent.scm +10 -10
……@@ -53,22 +53,22 @@
5353 (define NUML (Number 4))
5454 (define DICT (LgDict "any"))
5555
56 ; Increment the count on one edge.
57 (define (incr-cnt edge)
58 (SetValue edge (Predicate "count")
56 ; Increment the count on one atom.
57 (define (incr-cnt atom)
58 (SetValue atom (Predicate "count")
5959 (Plus (Number 0 0 1)
60 (FloatValueOf edge (Predicate "count")
60 (FloatValueOf atom (Predicate "count")
6161 (FloatValueOf (Number 0 0 0))))))
6262
63 ; Given a list (an Atomese LinkValue list) of parse results,
64 ; extract the edges and increment the count on them.
65 (define (edge-counter EDGE-LIST)
63 ; Given a list (an Atomese LinkValue list) of Atoms,
64 ; increment the count on each Atom.
65 (define (atom-counter ATOM-LIST)
6666 (Filter
6767 (Rule
68 (TypedVariable (Variable "$edge") (Type 'Edge))
68 (Variable "$edge")
6969 (Variable "$edge")
7070 (incr-cnt (Variable "$edge")))
71 EDGE-LIST))
71 ATOM-LIST))
7272
7373 ; Given PASRC holding a stream of parses, filter out the edges,
7474 ; and then applu function FUNKY to each edge.
……@@ -89,7 +89,7 @@
8989 ; (edge-filter (PureExecLink parser) edge-counter)
9090
9191 ; Return the parser.
92 (edge-filter parser edge-counter)
92 (edge-filter parser atom-counter)
9393)
9494
9595; --------------------------------------------------------------