OverviewFilesCommitsIssuesDocsReleasesPeers

opencog-agents commits / e4cbf8a

Fix issue with the naive implementation
e4cbf8a797432ce0aad0565cc164cf8c6d039c4e
by Linas Vepštas <linasvepstas@gmail.com> · 2024-04-09T18:03:37.000Z

Changed files (1) +16 -3

scm/pair-agent/count-agent.scm +16 -3
……@@ -23,6 +23,13 @@
2323; The Filter matches this, so that (Variable "$x") is equated with the
2424; list of Edges.
2525;
26; XXX Major design flaw, still needs work: the PhraseLink is placed in
27; the main AtomSpace. Thus, it accumulates there, plus also all of the
28; other Links that wrap it, including LgParseBinds, Rule, Filter etc.
29; Nuking the PhraseLink also nukes those, so lots of churn. Alternative
30; is to pass PhraseLink as a value, but then have threading issues...
31; ugh. let me think a moment.
32;
2633(define (obs-txt PLAIN-TEXT)
2734
2835 (define (incr-cnt edge)
……@@ -39,8 +46,11 @@
3946 (incr-cnt (Variable "$edge")))
4047 stuff))
4148
42 (define parseli
43 (PureExecLink (LgParseBonds (Phrase PLAIN-TEXT) DICT NUML)))
49 (define (parseli phrali)
50 (PureExecLink (LgParseBonds phrali DICT NUML)))
51
52 (define phrali (Phrase PLAIN-TEXT))
53
4454 (define filty
4555 (Filter
4656 (Rule
……@@ -56,9 +66,12 @@
5666 ; Rewrite
5767 (extract (Glob "$x"))
5868 )
59 parseli))
69 (parseli (phrali))))
6070
6171 (define parses (cog-execute! filty))
72
73 ; Remove the phrase-link, too.
74 (cog-extract-recursive! phrali)
6275 parses
6376)
6477