| … | … | @@ -23,6 +23,13 @@ |
| 23 | 23 | ; The Filter matches this, so that (Variable "$x") is equated with the |
| 24 | 24 | ; list of Edges. |
| 25 | 25 | ; |
| 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 | ; |
| 26 | 33 | (define (obs-txt PLAIN-TEXT) |
| 27 | 34 | |
| 28 | 35 | (define (incr-cnt edge) |
| … | … | @@ -39,8 +46,11 @@ |
| 39 | 46 | (incr-cnt (Variable "$edge"))) |
| 40 | 47 | stuff)) |
| 41 | 48 | |
| 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 | |
| 44 | 54 | (define filty |
| 45 | 55 | (Filter |
| 46 | 56 | (Rule |
| … | … | @@ -56,9 +66,12 @@ |
| 56 | 66 | ; Rewrite |
| 57 | 67 | (extract (Glob "$x")) |
| 58 | 68 | ) |
| 59 | | parseli)) |
| 69 | (parseli (phrali)))) |
| 60 | 70 | |
| 61 | 71 | (define parses (cog-execute! filty)) |
| 72 | |
| 73 | ; Remove the phrase-link, too. |
| 74 | (cog-extract-recursive! phrali) |
| 62 | 75 | parses |
| 63 | 76 | ) |
| 64 | 77 | |