OverviewFilesCommitsIssuesDocsReleasesPeers

opencog-agents commits / 80c745a

Expand demo description
80c745a06c1024b9c504dd8386bef050b3d3c5b3
by Linas Vepštas <linasvepstas@gmail.com> · 2024-05-02T18:21:02.000Z

Changed files (1) +15 -2

scm/pair-agent/count-agent.scm +15 -2
……@@ -77,7 +77,7 @@
7777 (define (parseli phrali)
7878 (PureExecLink (LgParseBonds phrali DICT NUML)))
7979
80 ; Given an Atom `phrali` hold text to be parsed, get that text,
80 ; Given an Atom `phrali` holding text to be parsed, get that text,
8181 ; parse it, and increment the counts on the edges.
8282 (define (filty phrali)
8383 (Filter
……@@ -100,7 +100,18 @@
100100 (filty txt-stream)
101101)
102102
103; Demo wrapper: Parse a string.
103; --------------------------------------------------------------
104; Demo wrapper showing how to use the above: Parse a string.
105; PLAIN-TEXT should be a scheme string.
106;
107; Verify this works as follows:
108; (obs-txt "this is a test")
109; (cog-report-counts)
110; Note the abundance of WordNodes listed in the report.
111; (cog-get-atoms 'WordNode)
112; Cleanup after use:
113; (for-each cog-extract-recursive! (cog-get-atoms 'WordNode))
114; (extract-type 'WordNode)
104115(define (obs-txt PLAIN-TEXT)
105116
106117 ; We don't need to create this over and over; once is enough.
……@@ -113,9 +124,11 @@
113124 (cog-execute! parser)
114125
115126 ; Remove the phrase-link, return the list of edges.
127 (cog-set-value! (Concept "foo") (Predicate "some place") #f)
116128 (cog-extract-recursive! phrali)
117129)
118130
131; --------------------------------------------------------------
119132; Demo wrapper: Parse contents of a file.
120133(define (obs-file FILE-NAME)
121134