| … | … | @@ -24,7 +24,10 @@ |
| 24 | 24 | ; list of Edges. |
| 25 | 25 | ; |
| 26 | 26 | (define (obs-txt PLAIN-TEXT) |
| 27 | | (define parses (cog-execute! |
| 27 | |
| 28 | (define parser |
| 29 | (PureExecLink (LgParseBonds (Phrase PLAIN-TEXT) DICT NUML))) |
| 30 | (define filt |
| 28 | 31 | (Filter |
| 29 | 32 | (Lambda |
| 30 | 33 | (Variable "$x") |
| … | … | @@ -32,7 +35,9 @@ |
| 32 | 35 | (Type 'LinkValue) |
| 33 | 36 | (Type 'LinkValue) |
| 34 | 37 | (Variable "$x"))) |
| 35 | | (PureExecLink (LgParseBonds (Phrase PLAIN-TEXT) DICT NUML))))) |
| 38 | parser)) |
| 39 | |
| 40 | (define parses (cog-execute! filt)) |
| 36 | 41 | parses |
| 37 | 42 | ) |
| 38 | 43 | |
| … | … | @@ -40,11 +45,20 @@ |
| 40 | 45 | ; How? Need: |
| 41 | 46 | ; 3) ConcatenateLink like AccumulateLink, but flattens |
| 42 | 47 | ; Is this needed? |
| 43 | | ; 4) IncrementLinks link cog-inc-value! |
| 44 | | ; 5) ForkStream to create two streams (so that each can get a |
| 45 | | ; distinct filter.) |
| 46 | | ; 5a) Alternately, support RuleLink so that multiple targets are allowed. |
| 47 | | ; Then, ForkStream is a special case of Rule. |
| 48 | ; 4) IncrementLink just like cog-inc-value! |
| 49 | ; 5) Support RuleLink so that sttream forking can be done with |
| 50 | ; multiple targets in the rule. |
| 51 | |
| 52 | ; Works but non-atomic. |
| 53 | ; Also requires RuleLink to work |
| 54 | (define ed (Edge (Bond "ANY") (List (Word "words") (Word "know")))) |
| 55 | (define (doinc) |
| 56 | (cog-execute! |
| 57 | (SetValue ed (Predicate "count") |
| 58 | (Plus (Number 0 0 1) |
| 59 | (Cond (FloatValueOf ed (Predicate "count")) |
| 60 | (FloatValueOf ed (Predicate "count")) |
| 61 | (FloatValueOf (Number 0 0 0))))))) |
| 48 | 62 | |
| 49 | 63 | |
| 50 | 64 | ; (load "count-agent.scm") |