File: 05_traits.pl

package info (click to toggle)
libtm-perl 1.56-7
  • links: PTS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 3,692 kB
  • ctags: 1,084
  • sloc: perl: 35,266; makefile: 48
file content (37 lines) | stat: -rw-r--r-- 612 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
use TM::Materialized::AsTMa;
my $tm = new TM::Materialized::AsTMa (file => 'examples/old_testament.atm');
$tm->sync_in;

Class::Trait->apply ( $tm => 'TM::Graph' );

use Data::Dumper;
print Dumper $tm->clusters;


my ($adam, $begets) = $tm->tids ('adam', 'begets');
warn Dumper [
	$tm->frontier ([ $adam ],
		       [
			 [ $begets ]
			])
	];

warn Dumper [
	$tm->frontier ([ $adam ],
		       bless [
			  [ $begets ]
			], '*')
	];

my ($apple, $eats) = $tm->tids ('apple_1', 'eats');

warn Dumper [
	$tm->frontier ([ $apple ],
		       [
			[ $eats ],
			[ bless [ [ $begets ] ], '*' ]
			]
		       )
	];