Minor improvements by introducing getters and setters instead of combinators
Change-Id: Ifcc801bab9ae8d085cef492880e81b7c0c71d19c
diff --git a/t/real/sgbr/script_single.t b/t/real/sgbr/script_single.t
index 934ce8a..553560a 100644
--- a/t/real/sgbr/script_single.t
+++ b/t/real/sgbr/script_single.t
@@ -17,9 +17,9 @@
};
my $f = dirname(__FILE__);
-my $script = catfile($f, '..', '..', 'script', 'korapxml2krill');
+my $script = catfile($f, '..', '..', '..', 'script', 'korapxml2krill');
-my $input = catdir($f, '..', 'sgbr', 'PRO-DUD', 'BSP-2013-01', '32');
+my $input = catdir($f, 'PRO-DUD', 'BSP-2013-01', '32');
my $output = tmpnam();
my $cache = tmpnam();
diff --git a/t/sort_tokens.t b/t/sort_tokens.t
index b5683d5..0db2c59 100644
--- a/t/sort_tokens.t
+++ b/t/sort_tokens.t
@@ -9,8 +9,8 @@
use_ok('KorAP::XML::Index::MultiTermTokenStream');
ok(my $mtt = KorAP::XML::Index::MultiTermToken->new, 'New token');
-ok(defined $mtt->o_start(0), 'Set start character offset');
-ok($mtt->o_end(5), 'Set end character offset');
+ok(defined $mtt->set_o_start(0), 'Set start character offset');
+ok($mtt->set_o_end(5), 'Set end character offset');
ok($mtt->add(term => '@:k=N',
pti => 128,
payload =>'<s>9'), 'Add token');
@@ -71,8 +71,8 @@
'Check string');
ok($mtt = KorAP::XML::Index::MultiTermToken->new, 'New token');
-ok(defined $mtt->o_start(0), 'Set start character offset');
-ok($mtt->o_end(5), 'Set end character offset');
+ok(defined $mtt->set_o_start(0), 'Set start character offset');
+ok($mtt->set_o_end(5), 'Set end character offset');
# 2-7 to 2-4
ok($mtt->add(term => '<:child-of',
diff --git a/t/tokens.t b/t/tokens.t
index ce083dd..9ea5bcd 100644
--- a/t/tokens.t
+++ b/t/tokens.t
@@ -16,36 +16,36 @@
o_end => 120
), 'Create new object');
-is($term->term, 'Baum');
-is($term->p_start, 0);
-is($term->p_end, 56);
-is($term->o_start, 34);
-is($term->o_end, 120);
-is($term->payload, '<i>56');
+is($term->get_term, 'Baum');
+is($term->get_p_start, 0);
+is($term->get_p_end, 56);
+is($term->get_o_start, 34);
+is($term->get_o_end, 120);
+is($term->get_payload, '<i>56');
is($term->to_string, 'Baum$<i>34<i>120<i>56<i>56');
ok($term = KorAP::XML::Index::MultiTerm->new(
term => 'Baum'
), 'Create new object');
-is($term->term, 'Baum');
-is($term->p_start, 0);
-is($term->p_end, 0);
-is($term->o_start, 0);
-is($term->o_end, 0);
-is($term->payload, undef);
+is($term->get_term, 'Baum');
+is($term->get_p_start, 0);
+is($term->get_p_end, 0);
+is($term->get_o_start, 0);
+is($term->get_o_end, 0);
+is($term->get_payload, undef);
is($term->to_string, 'Baum');
ok($term = KorAP::XML::Index::MultiTerm->new(
term => 'Ba#um'
), 'Create new object');
-is($term->term, 'Ba#um');
-is($term->p_start, 0);
-is($term->p_end, 0);
-is($term->o_start, 0);
-is($term->o_end, 0);
-is($term->payload, undef);
+is($term->get_term, 'Ba#um');
+is($term->get_p_start, 0);
+is($term->get_p_end, 0);
+is($term->get_o_start, 0);
+is($term->get_o_end, 0);
+is($term->get_payload, undef);
is($term->to_string, 'Ba\#um');
ok($term = KorAP::XML::Index::MultiTerm->new(
@@ -53,12 +53,12 @@
payload => '<i>45'
), 'Create new object');
-is($term->term, 'Ba#u$m');
-is($term->p_start, 0);
-is($term->p_end, 0);
-is($term->o_start, 0);
-is($term->o_end, 0);
-is($term->payload, '<i>45');
+is($term->get_term, 'Ba#u$m');
+is($term->get_p_start, 0);
+is($term->get_p_end, 0);
+is($term->get_o_start, 0);
+is($term->get_o_end, 0);
+is($term->get_payload, '<i>45');
is($term->to_string, 'Ba\#u\$m$<i>45');
use_ok('KorAP::XML::Tokenizer');