add two sample files.
authormoro <moro>
Wed, 12 Mar 2003 17:00:47 +0000 (17:00 +0000)
committermoro <moro>
Wed, 12 Mar 2003 17:00:47 +0000 (17:00 +0000)
sample1.pl [new file with mode: 0644]
sample2.pl [new file with mode: 0644]

diff --git a/sample1.pl b/sample1.pl
new file mode 100644 (file)
index 0000000..c651543
--- /dev/null
@@ -0,0 +1,5 @@
+use CHISE;
+
+my $s1 = CHISE->new(ideograph_daikanwa => 6942); # 「字」
+print $s1->dumpAttr;
+print $s1->strokes, "\n"; # 数を表示
diff --git a/sample2.pl b/sample2.pl
new file mode 100644 (file)
index 0000000..7c9833c
--- /dev/null
@@ -0,0 +1,18 @@
+# compareのsample
+use CHISE;
+
+my $s1 = CHISE->define_char(strokes => 12, radical => 9);
+my $s2 = CHISE->define_char(strokes => 12, radical => 9, ideograph_daikanwa => 694);
+my $c = $s1->compare($s2);
+
+if ($c == $CHISE::EXCLUSIVE) {
+  print "他的\n";
+} elsif ($c == $CHISE::HAVE_INTERSECTION) {
+  print "共通あり\n";
+} elsif ($c == $CHISE::PROPER_SUBSET) {
+  print "全合\n";
+} elsif ($c == $CHISE::PROPER_SUPERSET) {
+  print "全上合\n";
+} elsif ($c == $CHISE::EQSET) {
+  print "全一致\n";
+}