created.
[chise/perl.git] / sample2.pl
1 # compareのsample
2 use CHISE;
3
4 my $s1 = CHISE->define_char(strokes => 12, radical => 9);
5 my $s2 = CHISE->define_char(strokes => 12, radical => 9, daikanwa => 694);
6 my $c = $s1->compare($s2);
7
8 if ($c == $CHISE::EXCLUSIVE) {
9   print "他的\n";
10 } elsif ($c == $CHISE::HAVE_INTERSECTION) {
11   print "共通あり\n";
12 } elsif ($c == $CHISE::PROPER_SUBSET) {
13   print "全合\n";
14 } elsif ($c == $CHISE::PROPER_SUPERSET) {
15   print "全上合\n";
16 } elsif ($c == $CHISE::EQSET) {
17   print "全一致\n";
18 }