| … | … | @@ -53,22 +53,22 @@ |
| 53 | 53 | (define NUML (Number 4)) |
| 54 | 54 | (define DICT (LgDict "any")) |
| 55 | 55 | |
| 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") |
| 59 | 59 | (Plus (Number 0 0 1) |
| 60 | | (FloatValueOf edge (Predicate "count") |
| 60 | (FloatValueOf atom (Predicate "count") |
| 61 | 61 | (FloatValueOf (Number 0 0 0)))))) |
| 62 | 62 | |
| 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) |
| 66 | 66 | (Filter |
| 67 | 67 | (Rule |
| 68 | | (TypedVariable (Variable "$edge") (Type 'Edge)) |
| 68 | (Variable "$edge") |
| 69 | 69 | (Variable "$edge") |
| 70 | 70 | (incr-cnt (Variable "$edge"))) |
| 71 | | EDGE-LIST)) |
| 71 | ATOM-LIST)) |
| 72 | 72 | |
| 73 | 73 | ; Given PASRC holding a stream of parses, filter out the edges, |
| 74 | 74 | ; and then applu function FUNKY to each edge. |
| … | … | @@ -89,7 +89,7 @@ |
| 89 | 89 | ; (edge-filter (PureExecLink parser) edge-counter) |
| 90 | 90 | |
| 91 | 91 | ; Return the parser. |
| 92 | | (edge-filter parser edge-counter) |
| 92 | (edge-filter parser atom-counter) |
| 93 | 93 | ) |
| 94 | 94 | |
| 95 | 95 | ; -------------------------------------------------------------- |