Renamed ok_index_2() to ok_index() in Test::Krawfish
diff --git a/lib/Test/Krawfish.pm b/lib/Test/Krawfish.pm
index 7fdf6f7..e3a8409 100644
--- a/lib/Test/Krawfish.pm
+++ b/lib/Test/Krawfish.pm
@@ -7,28 +7,10 @@
use Test::More ();
use File::Basename 'dirname';
use File::Spec::Functions qw/catfile rel2abs splitdir/;
-our @EXPORT = qw(test_doc ok_index ok_index_file ok_index_koral matches
-ok_index_2 test_file); # Last line deprecated!
+our @EXPORT = qw(test_doc ok_index ok_index_file ok_index_koral matches);
use constant DEBUG => 0;
-sub test_file {
- my @file = @_;
- my ($x, $fn) = caller();
- my @caller_dir = splitdir(rel2abs(dirname($fn)));
- my $i = 3;
-
- warn join('', @caller_dir);
-
- # Remove path till 't'
- while ($caller_dir[-1] ne 't') {
- pop @caller_dir;
- return if $i-- < 0;
- };
-
- return catfile(@caller_dir, 'data', @file);
-};
-
sub test_doc {
my $kq = {};
@@ -55,13 +37,9 @@
return $kq;
};
+
+
sub ok_index {
- warn 'This is deprecated!';
- ok_index_2(@_);
-};
-
-
-sub ok_index_2 {
my $index = shift;
my $meta;
@@ -103,6 +81,8 @@
$tb->ok(defined $index->segment->add($kq), $desc);
};
+
+
sub ok_index_file {
my $index = shift;
my $file = shift;
@@ -138,6 +118,8 @@
$tb->ok(defined $index->segment->add($kq), $desc);
};
+
+
sub matches {
my ($query, $matches, $desc) = @_;
my $tb = Test::More->builder;
diff --git a/t/corpus/and.t b/t/corpus/and.t
index 74f4ffc..02df51a 100644
--- a/t/corpus/and.t
+++ b/t/corpus/and.t
@@ -7,25 +7,25 @@
use_ok('Krawfish::Index');
my $index = Krawfish::Index->new;
-ok_index_2($index, {
+ok_index($index, {
integer_id => 2,
author => 'Peter',
genre => 'novel',
integer_age => 4
} => [qw/aa bb/], 'Add complex document');
-ok_index_2($index, {
+ok_index($index, {
integer_id => 3,
author => 'Peter',
genre => 'novel',
integer_age => 3
} => [qw/aa bb/], 'Add complex document');
-ok_index_2($index, {
+ok_index($index, {
integer_id => 5,
author => 'Peter',
genre => 'newsletter',
integer_age => 4
} => [qw/aa bb/], 'Add complex document');
-ok_index_2($index, {
+ok_index($index, {
integer_id => 6,
author => 'Michael',
genre => 'newsletter',
diff --git a/t/corpus/class.t b/t/corpus/class.t
index b8b3f70..e78ad3d 100644
--- a/t/corpus/class.t
+++ b/t/corpus/class.t
@@ -18,17 +18,17 @@
ok(!Krawfish::Corpus::Class->new(undef, 25), 'Create class corpus');
my $index = Krawfish::Index->new;
-ok_index_2($index, {
+ok_index($index, {
id => 2,
author => 'David',
integer_age => 22
} => [qw/aa bb/], 'Add complex document');
-ok_index_2($index, {
+ok_index($index, {
id => 3,
author => 'David',
integer_age => 24
} => [qw/aa bb/], 'Add complex document');
-ok_index_2($index, {
+ok_index($index, {
id => 5,
author => 'David',
integer_age => 24
diff --git a/t/corpus/or.t b/t/corpus/or.t
index 77bac3c..489256b 100644
--- a/t/corpus/or.t
+++ b/t/corpus/or.t
@@ -7,9 +7,9 @@
use_ok('Krawfish::Index');
my $index = Krawfish::Index->new;
-ok_index_2($index, {id => 2} => [qw/aa bb/], 'Add complex document');
-ok_index_2($index, {id => 3} => [qw/aa bb/], 'Add complex document');
-ok_index_2($index, {id => 5} => [qw/aa bb/], 'Add complex document');
+ok_index($index, {id => 2} => [qw/aa bb/], 'Add complex document');
+ok_index($index, {id => 3} => [qw/aa bb/], 'Add complex document');
+ok_index($index, {id => 5} => [qw/aa bb/], 'Add complex document');
ok(my $cb = Krawfish::Koral::Corpus::Builder->new, 'Create CorpusBuilder');
@@ -32,8 +32,8 @@
ok(!$plan->next, 'No more next doc');
-ok_index_2($index, {id => 7} => [qw/aa bb/], 'Add complex document');
-ok_index_2($index, {id => 9} => [qw/aa bb/], 'Add complex document');
+ok_index($index, {id => 7} => [qw/aa bb/], 'Add complex document');
+ok_index($index, {id => 9} => [qw/aa bb/], 'Add complex document');
ok($query = $cb->bool_or(
$cb->string('id')->eq('3'),
diff --git a/t/index/fields.t b/t/index/fields.t
index df0ab69..1fc8c5f 100644
--- a/t/index/fields.t
+++ b/t/index/fields.t
@@ -54,16 +54,16 @@
ok($index = Krawfish::Index->new, 'Create new index');
-ok_index_2($index, {
+ok_index($index, {
id => 7,
integer_size => 2,
} => [qw/aa bb/], 'Add complex document');
-ok_index_2($index, {
+ok_index($index, {
id => 3,
integer_size => 3,
} => [qw/aa cc cc/], 'Add complex document');
-ok_index_2($index, {
+ok_index($index, {
id => 1,
integer_size => 17,
} => [qw/aa bb/], 'Add complex document');
diff --git a/t/index/postings_live.t b/t/index/postings_live.t
index 4ad23a7..8a1d417 100644
--- a/t/index/postings_live.t
+++ b/t/index/postings_live.t
@@ -76,25 +76,25 @@
use_ok('Krawfish::Koral::Corpus::Builder');
ok(my $index = Krawfish::Index->new, 'New index');
-ok_index_2($index, {
+ok_index($index, {
id => 2,
author => 'Peter',
genre => 'novel',
age => 4
} => [qw/aa bb/], 'Add complex document');
-ok_index_2($index, {
+ok_index($index, {
id => 3,
author => 'Peter',
genre => 'novel',
age => 3
} => [qw/aa bb/], 'Add complex document');
-ok_index_2($index, {
+ok_index($index, {
id => 5,
author => 'Peter',
genre => 'newsletter',
age => 4
} => [qw/aa bb/], 'Add complex document');
-ok_index_2($index, {
+ok_index($index, {
id => 6,
author => 'Michael',
genre => 'newsletter',
diff --git a/t/koral/boolean_token.t b/t/koral/boolean_token.t
index ca35a7e..04b9bb8 100644
--- a/t/koral/boolean_token.t
+++ b/t/koral/boolean_token.t
@@ -7,7 +7,7 @@
use_ok('Krawfish::Index');
my $index = Krawfish::Index->new;
-ok_index_2($index, '[a|b][a|b|c][a][b|c]', 'Add complex document');
+ok_index($index, '[a|b][a|b|c][a][b|c]', 'Add complex document');
# The problem is, that negativity in tokens is resolved using bool_and_not(any, neg).
diff --git a/t/koral/filter.t b/t/koral/filter.t
index 19826ac..050ced3 100644
--- a/t/koral/filter.t
+++ b/t/koral/filter.t
@@ -9,17 +9,17 @@
my $index = Krawfish::Index->new;
-ok_index_2($index, {
+ok_index($index, {
docID => 7,
author => 'Carol'
} => [qw/aa bb/], 'Add complex document');
-ok_index_2($index, {
+ok_index($index, {
docID => 3,
author => 'Arthur'
} => [qw/aa bb cc/], 'Add complex document');
-ok_index_2($index, {
+ok_index($index, {
docID => 1,
author => 'Bob'
} => [qw/aa bb cc/], 'Add complex document');
diff --git a/t/koral/inflate.t b/t/koral/inflate.t
index fa17599..1f8c2f2 100644
--- a/t/koral/inflate.t
+++ b/t/koral/inflate.t
@@ -7,7 +7,7 @@
use_ok('Krawfish::Koral::Query::Builder');
my $index = Krawfish::Index->new;
-ok_index_2($index, [qw/aa bb aa bc ac bb cc ca/], 'Add complex document');
+ok_index($index, [qw/aa bb aa bc ac bb cc ca/], 'Add complex document');
# Simple
ok(my $qb = Krawfish::Koral::Query::Builder->new, 'Create Builder');
diff --git a/t/koral/sequential.t b/t/koral/sequential.t
index dd2f532..7cf2e5a 100644
--- a/t/koral/sequential.t
+++ b/t/koral/sequential.t
@@ -8,8 +8,8 @@
use_ok('Krawfish::Index');
my $index = Krawfish::Index->new;
-ok_index_2($index, '[a|b][a|b|c][a][b|c]', 'Add complex document');
-ok_index_2($index, '[b][b|c][a]', 'Add complex document');
+ok_index($index, '[a|b][a|b|c][a][b|c]', 'Add complex document');
+ok_index($index, '[b][b|c][a]', 'Add complex document');
# c: 3
# a: 4
# b: 5
diff --git a/t/koral/sequential_distances.t b/t/koral/sequential_distances.t
index f4aa6bc..c0e33ad 100644
--- a/t/koral/sequential_distances.t
+++ b/t/koral/sequential_distances.t
@@ -8,8 +8,8 @@
use_ok('Krawfish::Index');
my $index = Krawfish::Index->new;
-ok_index_2($index, '[a|b][a|b|c][a][b|c]', 'Add complex document');
-ok_index_2($index, '[b][b|c][a]', 'Add complex document');
+ok_index($index, '[a|b][a|b|c][a][b|c]', 'Add complex document');
+ok_index($index, '[b][b|c][a]', 'Add complex document');
# c: 3
# a: 4
# b: 5
diff --git a/t/koral/sequential_negation.t b/t/koral/sequential_negation.t
index e364705..fdedef3 100644
--- a/t/koral/sequential_negation.t
+++ b/t/koral/sequential_negation.t
@@ -8,8 +8,8 @@
use_ok('Krawfish::Index');
my $index = Krawfish::Index->new;
-ok_index_2($index, '[a|b][a|b|c][a][b|c]', 'Add complex document');
-ok_index_2($index, '[b][b|c][a]', 'Add complex document');
+ok_index($index, '[a|b][a|b|c][a][b|c]', 'Add complex document');
+ok_index($index, '[b][b|c][a]', 'Add complex document');
# c: 3
# a: 4
# b: 5
diff --git a/t/plan/exclusion.t b/t/plan/exclusion.t
index cf4c053..4fcfe07 100644
--- a/t/plan/exclusion.t
+++ b/t/plan/exclusion.t
@@ -10,7 +10,7 @@
my $koral = Krawfish::Koral->new;
my $qb = $koral->query_builder;
-ok_index_2($index, '<1:aa>[aa]</1>[bb][aa][bb]', 'Add new document');
+ok_index($index, '<1:aa>[aa]</1>[bb][aa][bb]', 'Add new document');
# Exclusion planning
diff --git a/t/plan/meta.t b/t/plan/meta.t
index 83cfc50..0f7a951 100644
--- a/t/plan/meta.t
+++ b/t/plan/meta.t
@@ -9,26 +9,26 @@
# Create some documents
my $index = Krawfish::Index->new;
-ok_index_2($index, {
+ok_index($index, {
id => 2,
author => 'Peter',
genre => 'novel',
age => 4
} => [qw/aa bb/], 'Add complex document');
-ok_index_2($index, {
+ok_index($index, {
id => 3,
author => 'Peter',
genre => 'novel',
age => 3
} => [qw/aa bb/], 'Add complex document');
-ok_index_2($index, {
+ok_index($index, {
id => 5,
author => 'Peter',
genre => 'newsletter',
title => 'Your way to success!',
age => 4
} => [qw/aa bb/], 'Add complex document');
-ok_index_2($index, {
+ok_index($index, {
id => 6,
author => 'Michael',
genre => 'newsletter',
diff --git a/t/plan/position.t b/t/plan/position.t
index 5ee96cd..f1664ce 100644
--- a/t/plan/position.t
+++ b/t/plan/position.t
@@ -8,7 +8,7 @@
my $index = Krawfish::Index->new;
-ok_index_2($index, '<1:opennlp/c=NP>[Der][hey]</1>', 'Add new document');
+ok_index($index, '<1:opennlp/c=NP>[Der][hey]</1>', 'Add new document');
my $koral = Krawfish::Koral->new;
diff --git a/t/plan/repetition.t b/t/plan/repetition.t
index 2226c89..d403b4d 100644
--- a/t/plan/repetition.t
+++ b/t/plan/repetition.t
@@ -8,7 +8,7 @@
my $index = Krawfish::Index->new;
-ok_index_2($index, '<1:aaa>[hey][hey]</1>', 'Add new document');
+ok_index($index, '<1:aaa>[hey][hey]</1>', 'Add new document');
my $koral = Krawfish::Koral->new;
diff --git a/t/plan/term_group.t b/t/plan/term_group.t
index 22500d0..3d89a8f 100644
--- a/t/plan/term_group.t
+++ b/t/plan/term_group.t
@@ -8,14 +8,9 @@
use_ok('Krawfish::Index');
-sub cat_t {
- return catfile(dirname(__FILE__), '..', @_);
-};
-
-
my $index = Krawfish::Index->new;
-ok_index_2($index, [qw/first second third fourth fifth sixth/], 'Add new document');
+ok_index($index, [qw/first second third fourth fifth sixth/], 'Add new document');
my $koral = Krawfish::Koral->new;
diff --git a/t/plan/term_re.t b/t/plan/term_re.t
index 134ba0c..ff05b99 100644
--- a/t/plan/term_re.t
+++ b/t/plan/term_re.t
@@ -22,7 +22,7 @@
is($re->min_span, 1, 'Span length');
is($re->max_span, 1, 'Span length');
-ok_index_2($index,'[a/b=CDE|a/c=FGH][a/l=PART|a/l=BAU|a/l=PUM][b/c=DAU][e/f=UM]', 'Add doc');
+ok_index($index,'[a/b=CDE|a/c=FGH][a/l=PART|a/l=BAU|a/l=PUM][b/c=DAU][e/f=UM]', 'Add doc');
ok(my $plan = $re->normalize->finalize->identify($index->dict)->optimize($index->segment), 'Plan Regex');
diff --git a/t/query/class.t b/t/query/class.t
index e75523b..10af3c2 100644
--- a/t/query/class.t
+++ b/t/query/class.t
@@ -7,7 +7,7 @@
use_ok('Krawfish::Koral::Query::Builder');
my $index = Krawfish::Index->new;
-ok_index_2($index, [qw/aa bb aa bb/], 'Add new document');
+ok_index($index, [qw/aa bb aa bb/], 'Add new document');
ok(my $qb = Krawfish::Koral::Query::Builder->new, 'Create QueryBuilder');
ok(my $wrap = $qb->class($qb->token('bb'), 2), 'Class');
diff --git a/t/query/clone.t b/t/query/clone.t
index 111ee3e..4c8eefc 100644
--- a/t/query/clone.t
+++ b/t/query/clone.t
@@ -10,15 +10,15 @@
use_ok('Krawfish::Koral');
my $index = Krawfish::Index->new;
-ok_index_2($index, {
+ok_index($index, {
id => 1,
genre => 'novel',
} => '[a|b]<1:x>[a|b|c]</1>[a][b|c]', 'Add complex document');
-ok_index_2($index, {
+ok_index($index, {
id => 2,
genre => 'news',
} => '[a|b][a|b|c][a][b|c]', 'Add complex document');
-ok_index_2($index, {
+ok_index($index, {
id => 3,
genre => 'novel',
} => '<1:x>[a|b][a|b|c][a]</1>[b|c]', 'Add complex document');
diff --git a/t/query/constraints_class_distance.t b/t/query/constraints_class_distance.t
index 6de6d63..54abf91 100644
--- a/t/query/constraints_class_distance.t
+++ b/t/query/constraints_class_distance.t
@@ -7,7 +7,7 @@
use_ok('Krawfish::Koral::Query::Builder');
my $index = Krawfish::Index->new;
-ok_index_2($index, [qw/aa bb aa bb aa bb/], 'Add complex document');
+ok_index($index, [qw/aa bb aa bb aa bb/], 'Add complex document');
my $qb = Krawfish::Koral::Query::Builder->new;
diff --git a/t/query/constraints_in_between.t b/t/query/constraints_in_between.t
index 7fe0d54..48d5cd5 100644
--- a/t/query/constraints_in_between.t
+++ b/t/query/constraints_in_between.t
@@ -7,7 +7,7 @@
use_ok('Krawfish::Koral::Query::Builder');
my $index = Krawfish::Index->new;
-ok_index_2($index, [qw/aa bb aa bb aa bb/], 'Add complex document');
+ok_index($index, [qw/aa bb aa bb aa bb/], 'Add complex document');
my $qb = Krawfish::Koral::Query::Builder->new;
diff --git a/t/query/constraints_not_between.t b/t/query/constraints_not_between.t
index 5eee28b..7fe5361 100644
--- a/t/query/constraints_not_between.t
+++ b/t/query/constraints_not_between.t
@@ -7,9 +7,9 @@
use_ok('Krawfish::Koral::Query::Builder');
my $index = Krawfish::Index->new;
-ok_index_2($index, '[aa|xx][cc][bb|xx]', 'Add complex document');
-ok_index_2($index, '[aa|xx][dd][bb|xx]', 'Add complex document');
-ok_index_2($index, '[aa|xx][cc][bb|xx]', 'Add complex document');
+ok_index($index, '[aa|xx][cc][bb|xx]', 'Add complex document');
+ok_index($index, '[aa|xx][dd][bb|xx]', 'Add complex document');
+ok_index($index, '[aa|xx][cc][bb|xx]', 'Add complex document');
my $qb = Krawfish::Koral::Query::Builder->new;
diff --git a/t/query/constraints_position.t b/t/query/constraints_position.t
index 81d8127..2b91495 100644
--- a/t/query/constraints_position.t
+++ b/t/query/constraints_position.t
@@ -7,7 +7,7 @@
use_ok('Krawfish::Koral::Query::Builder');
my $index = Krawfish::Index->new;
-ok_index_2($index, '[aa|aa][bb|bb]', 'Add complex document');
+ok_index($index, '[aa|aa][bb|bb]', 'Add complex document');
my $qb = Krawfish::Koral::Query::Builder->new;
@@ -27,7 +27,7 @@
# From t/query/positions.t
$index = Krawfish::Index->new;
-ok_index_2($index, [qw/aa bb aa bb/], 'Add new document');
+ok_index($index, [qw/aa bb aa bb/], 'Add new document');
ok($wrap = $qb->constraints(
[$qb->c_position('precedesDirectly')],
$qb->token('aa'),
@@ -41,7 +41,7 @@
# Reset index - situation [aa]..[bb] -> [aa][bb]
$index = Krawfish::Index->new;
-ok_index_2($index, '[aa][cc][aa][bb]', 'Add complex document');
+ok_index($index, '[aa][cc][aa][bb]', 'Add complex document');
ok($qb = Krawfish::Koral::Query::Builder->new, 'Create Koral::Builder');
ok($wrap = $qb->constraints(
[$qb->c_position('precedesDirectly')],
@@ -53,7 +53,7 @@
# Reset index - situation [bb][aa] -> [aa][bb]
$index = Krawfish::Index->new;
-ok_index_2($index, '[bb][aa][bb][aa]', 'Add complex document');
+ok_index($index, '[bb][aa][bb][aa]', 'Add complex document');
ok($qb = Krawfish::Koral::Query::Builder->new, 'Create Koral::Builder');
ok($wrap = $qb->constraints(
[$qb->c_position('precedesDirectly')],
@@ -66,7 +66,7 @@
# Reset index - situation [aa]..[bb] -> [aa][bb]
$index = Krawfish::Index->new;
-ok_index_2($index,'[aa][cc][aa][bb]', 'Add complex document');
+ok_index($index,'[aa][cc][aa][bb]', 'Add complex document');
ok($qb = Krawfish::Koral::Query::Builder->new, 'Create Koral::Builder');
ok($wrap = $qb->position(['precedesDirectly'],$qb->token('aa'), $qb->token('bb')), 'Sequence');
ok($seq = $wrap->normalize->finalize->identify($index->dict)->optimize($index->segment), 'Rewrite');
@@ -77,7 +77,7 @@
# Reset index - situation [bb]..[aa] -> [aa][bb]
$index = Krawfish::Index->new;
-ok_index_2($index,'[bb][cc][aa][bb]', 'Add complex document');
+ok_index($index,'[bb][cc][aa][bb]', 'Add complex document');
ok($qb = Krawfish::Koral::Query::Builder->new($index), 'Create Koral::Builder');
ok($wrap = $qb->constraints(
[$qb->c_position('precedesDirectly')],
@@ -93,7 +93,7 @@
# Multiple matches
# Reset index - situation [bb]..[aa] -> [aa][bb]
$index = Krawfish::Index->new;
-ok_index_2($index,'[aa|aa][bb|bb]', 'Add complex document');
+ok_index($index,'[aa|aa][bb|bb]', 'Add complex document');
ok($qb = Krawfish::Koral::Query::Builder->new, 'Create Koral::Builder');
ok($wrap = $qb->constraints(
[$qb->c_position('precedesDirectly')],
@@ -108,7 +108,7 @@
# Reset index
$index = Krawfish::Index->new;
-ok_index_2($index, '[aa][bb|bb]', 'Add complex document');
+ok_index($index, '[aa][bb|bb]', 'Add complex document');
ok($qb = Krawfish::Koral::Query::Builder->new, 'Create Koral::Builder');
ok($wrap = $qb->constraints(
[$qb->c_position('precedesDirectly')],
@@ -122,7 +122,7 @@
# Reset index
$index = Krawfish::Index->new;
-ok_index_2($index, '[aa|aa][bb]', 'Add complex document');
+ok_index($index, '[aa|aa][bb]', 'Add complex document');
ok($qb = Krawfish::Koral::Query::Builder->new($index), 'Create Koral::Builder');
ok($wrap = $qb->constraints(
[$qb->c_position('precedesDirectly')],
@@ -136,7 +136,7 @@
# Reset index
$index = Krawfish::Index->new;
-ok_index_2($index, '[aa|aa][bb|bb][aa|aa][bb|bb]', 'Add complex document');
+ok_index($index, '[aa|aa][bb|bb][aa|aa][bb|bb]', 'Add complex document');
ok($qb = Krawfish::Koral::Query::Builder->new, 'Create Koral::Builder');
ok($wrap = $qb->constraints(
[$qb->c_position('precedesDirectly')],
@@ -151,10 +151,10 @@
# Reset index
$index = Krawfish::Index->new;
-ok_index_2($index, '[aa|aa][bb|bb][aa|aa][bb|bb]', 'Add complex document');
-ok_index_2($index, '[aa]', 'Add complex document');
-ok_index_2($index, '[bb]', 'Add complex document');
-ok_index_2($index, '[aa|aa][bb|bb][aa|aa][bb|bb]', 'Add complex document');
+ok_index($index, '[aa|aa][bb|bb][aa|aa][bb|bb]', 'Add complex document');
+ok_index($index, '[aa]', 'Add complex document');
+ok_index($index, '[bb]', 'Add complex document');
+ok_index($index, '[aa|aa][bb|bb][aa|aa][bb|bb]', 'Add complex document');
ok($qb = Krawfish::Koral::Query::Builder->new, 'Create Koral::Builder');
ok($wrap = $qb->constraints(
[$qb->c_position('precedesDirectly')],
@@ -171,7 +171,7 @@
## Overlap
$index = Krawfish::Index->new;
-ok_index_2($index, '[aa|bb][aa|bb][aa|bb][aa|bb]', 'Add new document');
+ok_index($index, '[aa|bb][aa|bb][aa|bb][aa|bb]', 'Add new document');
ok($wrap = $qb->position(
['overlapsLeft'],
$qb->class($qb->repeat($qb->token('aa'), 1, undef),1),
diff --git a/t/query/exclusion.t b/t/query/exclusion.t
index 019cfe0..d9ac9e3 100644
--- a/t/query/exclusion.t
+++ b/t/query/exclusion.t
@@ -23,7 +23,7 @@
# Exclusion planning
-ok_index_2($index, '<1:aa>[bb][bb]</1><2:aa>[cc]</2>', 'Add complex document');
+ok_index($index, '<1:aa>[bb][bb]</1><2:aa>[cc]</2>', 'Add complex document');
ok($wrap = $query->normalize->finalize->identify($index->dict)->optimize($index->segment), 'Planning');
is($wrap->to_string, "excl(432:#3,#2)",
'Planned Stringification');
@@ -38,8 +38,8 @@
$qb->token('bb')
);
$index = Krawfish::Index->new;
-ok_index_2($index, '<1:aa>[bb][bb]</1><2:aa><3:aa>[cc]</3>[bb]</2>', 'Add complex document');
-ok_index_2($index, '<1:aa>[dd]</1><2:aa>[dd][bb]</2><3:aa>[dd]</3>', 'Add complex document');
+ok_index($index, '<1:aa>[bb][bb]</1><2:aa><3:aa>[cc]</3>[bb]</2>', 'Add complex document');
+ok_index($index, '<1:aa>[dd]</1><2:aa>[dd][bb]</2><3:aa>[dd]</3>', 'Add complex document');
ok($wrap = $query->normalize->finalize, 'Planning');
is($wrap->to_string, "excl(432:<aa>,bb)",
'Planned Stringification');
@@ -61,8 +61,8 @@
$qb->token('bb')
);
$index = Krawfish::Index->new;
-ok_index_2($index, '<1:aa>[bb][bb]</1><2:aa><3:aa>[cc]</3>[bb]</2>', 'Add complex document');
-ok_index_2($index, '<1:aa>[dd]</1><2:aa>[dd][bb]</2><3:aa>[dd]</3>', 'Add complex document');
+ok_index($index, '<1:aa>[bb][bb]</1><2:aa><3:aa>[cc]</3>[bb]</2>', 'Add complex document');
+ok_index($index, '<1:aa>[dd]</1><2:aa>[dd][bb]</2><3:aa>[dd]</3>', 'Add complex document');
ok($wrap = $query->normalize->finalize->identify($index->dict)->optimize($index->segment), 'Planning');
matches($wrap, [qw/[0:2-3] [1:0-1] [1:3-4]/], 'Matches');
@@ -164,9 +164,9 @@
$qb->token('bb')
);
$index = Krawfish::Index->new;
-ok_index_2($index, '[aa|bb][bb]', 'Add complex document');
-ok_index_2($index, '[aa]', 'Add complex document');
-ok_index_2($index, '[aa]', 'Add complex document');
+ok_index($index, '[aa|bb][bb]', 'Add complex document');
+ok_index($index, '[aa]', 'Add complex document');
+ok_index($index, '[aa]', 'Add complex document');
is($query->to_string, 'excl(2:[aa],[bb])', 'Stringification');
@@ -182,7 +182,7 @@
-ok_index_2($index, '[bb]', 'Add complex document');
+ok_index($index, '[bb]', 'Add complex document');
$query = $qb->exclusion(
[qw/precedesDirectly/],
$qb->token('aa'),
@@ -193,7 +193,7 @@
-ok_index_2($index, '[aa][bb]', 'Add complex document');
+ok_index($index, '[aa][bb]', 'Add complex document');
$query = $qb->exclusion(
[qw/precedesDirectly/],
$qb->token('aa'),
diff --git a/t/query/filter.t b/t/query/filter.t
index 8606698..00f4bee 100644
--- a/t/query/filter.t
+++ b/t/query/filter.t
@@ -8,15 +8,15 @@
use_ok('Krawfish::Index');
my $index = Krawfish::Index->new;
-ok_index_2($index, {
+ok_index($index, {
id => 1,
genre => 'novel',
} => [qw/aa bb aa bb cc/], 'Add complex document');
-ok_index_2($index, {
+ok_index($index, {
id => 2,
genre => 'news',
} => [qw/aa bb aa/], 'Add complex document');
-ok_index_2($index, {
+ok_index($index, {
id => 3,
genre => 'novel',
} => [qw/aa cc/], 'Add complex document');
diff --git a/t/query/length.t b/t/query/length.t
index 29e0767..b87a961 100644
--- a/t/query/length.t
+++ b/t/query/length.t
@@ -7,7 +7,7 @@
use_ok('Krawfish::Koral::Query::Builder');
my $index = Krawfish::Index->new;
-ok_index_2($index, [qw/aa bb aa bb aa bb aa bb aa bb/], 'Add complex document');
+ok_index($index, [qw/aa bb aa bb aa bb aa bb aa bb/], 'Add complex document');
my $qb = Krawfish::Koral::Query::Builder->new;
diff --git a/t/query/match.t b/t/query/match.t
index 241cdd0..50d9105 100644
--- a/t/query/match.t
+++ b/t/query/match.t
@@ -8,15 +8,15 @@
my $index = Krawfish::Index->new;
-ok_index_2($index, {
+ok_index($index, {
id => 'doc-2',
license => 'free'
} => [qw/aa bb/], 'Add complex document');
-ok_index_2($index, {
+ok_index($index, {
id => 'doc-1',
license => 'free'
} => [qw/aa cc cc/], 'Add complex document');
-ok_index_2($index, {
+ok_index($index, {
id => 'doc-3',
license => 'closed'
} => [qw/aa bb/], 'Add complex document');
diff --git a/t/query/next.t b/t/query/next.t
index 74f7300..9e749cb 100644
--- a/t/query/next.t
+++ b/t/query/next.t
@@ -22,7 +22,7 @@
is($seq->current->to_string, '[1:6-8]', 'Match');
ok(!$seq->next, 'No more');
-ok_index_2($index, [qw/aa bb aa bb/], 'Add new document');
+ok_index($index, [qw/aa bb aa bb/], 'Add new document');
ok($wrap = $qb->seq($qb->token('aa'), $qb->token('bb')), 'Seq');
ok($seq = $wrap->normalize->finalize->identify($index->dict)->optimize($index->segment), 'Rewrite');
@@ -35,7 +35,7 @@
# Reset index - situation [aa]..[bb] -> [aa][bb]
$index = Krawfish::Index->new;
-ok_index_2($index, '[aa][cc][aa][bb]', 'Add complex document');
+ok_index($index, '[aa][cc][aa][bb]', 'Add complex document');
ok($qb = Krawfish::Koral::Query::Builder->new, 'Create QueryBuilder');
ok($wrap = $qb->seq($qb->token('aa'), $qb->token('bb')), 'Seq');
ok($seq = $wrap->normalize->finalize->identify($index->dict)->optimize($index->segment), 'Rewrite');
@@ -43,7 +43,7 @@
# Reset index - situation [bb][aa] -> [aa][bb]
$index = Krawfish::Index->new;
-ok_index_2($index, '[bb][aa][bb][aa]', 'Add complex document');
+ok_index($index, '[bb][aa][bb][aa]', 'Add complex document');
ok($qb = Krawfish::Koral::Query::Builder->new, 'Create QueryBuilder');
ok($wrap = $qb->seq($qb->token('aa'), $qb->token('bb')), 'Seq');
ok($seq = $wrap->normalize->finalize->identify($index->dict)->optimize($index->segment), 'Rewrite');
@@ -52,7 +52,7 @@
# Reset index - situation [aa]..[bb] -> [aa][bb]
$index = Krawfish::Index->new;
-ok_index_2($index, '[aa][cc][aa][bb]', 'Add complex document');
+ok_index($index, '[aa][cc][aa][bb]', 'Add complex document');
ok($qb = Krawfish::Koral::Query::Builder->new, 'Create QueryBuilder');
ok($wrap = $qb->seq($qb->token('aa'), $qb->token('bb')), 'Seq');
ok($seq = $wrap->normalize->finalize->identify($index->dict)->optimize($index->segment), 'Rewrite');
@@ -61,7 +61,7 @@
# Reset index - situation [bb]..[aa] -> [aa][bb]
$index = Krawfish::Index->new;
-ok_index_2($index, '[bb][cc][aa][bb]', 'Add complex document');
+ok_index($index, '[bb][cc][aa][bb]', 'Add complex document');
ok($qb = Krawfish::Koral::Query::Builder->new, 'Create QueryBuilder');
ok($wrap = $qb->seq($qb->token('aa'), $qb->token('bb')), 'Seq');
ok($seq = $wrap->normalize->finalize->identify($index->dict)->optimize($index->segment), 'Rewrite');
@@ -71,7 +71,7 @@
# Multiple matches
# Reset index
$index = Krawfish::Index->new;
-ok_index_2($index, '[aa|aa][bb|bb]', 'Add complex document');
+ok_index($index, '[aa|aa][bb|bb]', 'Add complex document');
ok($qb = Krawfish::Koral::Query::Builder->new, 'Create QueryBuilder');
ok($wrap = $qb->seq($qb->token('aa'), $qb->token('bb')), 'Seq');
ok($seq = $wrap->normalize->finalize->identify($index->dict)->optimize($index->segment), 'Rewrite');
@@ -80,7 +80,7 @@
# Reset index
$index = Krawfish::Index->new;
-ok_index_2($index, '[aa][bb|bb]', 'Add complex document');
+ok_index($index, '[aa][bb|bb]', 'Add complex document');
ok($qb = Krawfish::Koral::Query::Builder->new, 'Create QueryBuilder');
ok($wrap = $qb->seq($qb->token('aa'), $qb->token('bb')), 'Seq');
ok($seq = $wrap->normalize->finalize->identify($index->dict)->optimize($index->segment), 'Rewrite');
@@ -90,7 +90,7 @@
# Reset index
$index = Krawfish::Index->new;
-ok_index_2($index, '[aa|aa][bb]', 'Add complex document');
+ok_index($index, '[aa|aa][bb]', 'Add complex document');
ok($qb = Krawfish::Koral::Query::Builder->new, 'Create QueryBuilder');
ok($wrap = $qb->seq($qb->token('aa'), $qb->token('bb')), 'Seq');
ok($seq = $wrap->normalize->finalize->identify($index->dict)->optimize($index->segment), 'Rewrite');
@@ -99,7 +99,7 @@
# Reset index
$index = Krawfish::Index->new;
-ok_index_2($index, '[aa|aa][bb|bb][aa|aa][bb|bb]', 'Add complex document');
+ok_index($index, '[aa|aa][bb|bb][aa|aa][bb|bb]', 'Add complex document');
ok($qb = Krawfish::Koral::Query::Builder->new, 'Create QueryBuilder');
ok($wrap = $qb->seq($qb->token('aa'), $qb->token('bb')), 'Seq');
ok($seq = $wrap->normalize->finalize->identify($index->dict)->optimize($index->segment), 'Rewrite');
@@ -108,7 +108,7 @@
# Reset index
$index = Krawfish::Index->new;
-ok_index_2($index, '<1:aa><2:aa>[bb]</2>[bb]</1>', 'Add complex document');
+ok_index($index, '<1:aa><2:aa>[bb]</2>[bb]</1>', 'Add complex document');
ok($qb = Krawfish::Koral::Query::Builder->new, 'Create QueryBuilder');
ok($wrap = $qb->seq($qb->span('aa'), $qb->token('bb')), 'Seq');
is($wrap->to_string, '<aa>[bb]', 'Stringification');
diff --git a/t/query/repetition.t b/t/query/repetition.t
index 9bdbf59..0b1ffda 100644
--- a/t/query/repetition.t
+++ b/t/query/repetition.t
@@ -9,7 +9,7 @@
my $index = Krawfish::Index->new;
-ok_index_2($index, [qw/aa bb bb bb bb cc/], 'Add new document');
+ok_index($index, [qw/aa bb bb bb bb cc/], 'Add new document');
my $qb = Krawfish::Koral::Query::Builder->new;
@@ -36,8 +36,8 @@
# Next test
$index = Krawfish::Index->new;
-ok_index_2($index, [qw/aa bb bb bb cc/], 'Add new document');
-ok_index_2($index, [qw/bb bb bb bb cc/], 'Add new document');
+ok_index($index, [qw/aa bb bb bb cc/], 'Add new document');
+ok_index($index, [qw/bb bb bb bb cc/], 'Add new document');
ok($wrap = $qb->repeat( $qb->token('bb'), 1, 3), 'Repeat');
is($wrap->to_string, '[bb]{1,3}', 'Stringification');
@@ -62,7 +62,7 @@
# Next test
$index = Krawfish::Index->new;
-ok_index_2($index, [qw/bb bb bb cc bb bb bb bb dd bb/], 'Add new document');
+ok_index($index, [qw/bb bb bb cc bb bb bb bb dd bb/], 'Add new document');
ok($wrap = $qb->repeat( $qb->token('bb'), 1, 3), 'Repeat');
is($wrap->to_string, '[bb]{1,3}', 'Stringification');
diff --git a/t/query/span_or.t b/t/query/span_or.t
index 99476ae..b123086 100644
--- a/t/query/span_or.t
+++ b/t/query/span_or.t
@@ -11,8 +11,8 @@
ok(my $qb = Krawfish::Koral::Query::Builder->new, 'Create Koral::Builder');
my $index = Krawfish::Index->new;
-ok_index_2($index, '[a|b][a|b|c][a][b|c]', 'Add complex document');
-ok_index_2($index, '[b][b|c][a]', 'Add complex document');
+ok_index($index, '[a|b][a|b|c][a][b|c]', 'Add complex document');
+ok_index($index, '[b][b|c][a]', 'Add complex document');
my $query = $qb->bool_or(
$qb->token('a'), $qb->token('b'), $qb->token('c')
diff --git a/t/query/term_group.t b/t/query/term_group.t
index 9129cdb..3c492e1 100644
--- a/t/query/term_group.t
+++ b/t/query/term_group.t
@@ -10,7 +10,7 @@
# [aa&!bb]
my $index = Krawfish::Index->new;
-ok_index_2($index, '[aa|bb][aa|bb|cc][aa][bb|cc]', 'Add complex document');
+ok_index($index, '[aa|bb][aa|bb|cc][aa][bb|cc]', 'Add complex document');
my $token = $qb->token(
$qb->bool_and('aa', $qb->term_neg('bb'))
);
@@ -24,7 +24,7 @@
# [aa&!bb]
$index = Krawfish::Index->new;
-ok_index_2($index, '[aa|bb][aa|bb|cc][aa][bb|cc]', 'Add complex document');
+ok_index($index, '[aa|bb][aa|bb|cc][aa][bb|cc]', 'Add complex document');
$token = $qb->token(
$qb->bool_or(
$qb->bool_and('aa', $qb->term_neg('bb')),
diff --git a/t/query/unique.t b/t/query/unique.t
index 9ba631d..7b3f0e3 100644
--- a/t/query/unique.t
+++ b/t/query/unique.t
@@ -8,7 +8,7 @@
ok(my $qb = Krawfish::Koral::Query::Builder->new, 'Create Koral::Builder');
my $index = Krawfish::Index->new;
-ok_index_2($index, '[aa|bb][aa|bb][aa|bb]', 'Add new document');
+ok_index($index, '[aa|bb][aa|bb][aa|bb]', 'Add new document');
my $query = $qb->token(
$qb->bool_or('aa', 'bb')
diff --git a/t/result/group_fields.t b/t/result/group_fields.t
index 17b5c14..f9a94c7 100644
--- a/t/result/group_fields.t
+++ b/t/result/group_fields.t
@@ -9,25 +9,25 @@
my $index = Krawfish::Index->new;
-ok_index_2($index, {
+ok_index($index, {
id => 2,
author => 'Peter',
genre => 'novel',
age => 4
} => [qw/aa bb/], 'Add complex document');
-ok_index_2($index, {
+ok_index($index, {
id => 3,
author => 'Peter',
genre => 'novel',
age => 3
} => [qw/aa bb/], 'Add complex document');
-ok_index_2($index, {
+ok_index($index, {
id => 5,
author => 'Peter',
genre => 'newsletter',
age => 4
} => [qw/aa bb/], 'Add complex document');
-ok_index_2($index, {
+ok_index($index, {
id => 6,
author => 'Michael',
genre => 'newsletter',
diff --git a/t/result/limit.t b/t/result/limit.t
index 9091988..86eace5 100644
--- a/t/result/limit.t
+++ b/t/result/limit.t
@@ -8,15 +8,15 @@
my $index = Krawfish::Index->new;
-ok_index_2($index, {
+ok_index($index, {
id => 7,
author => 'Carol'
} => [qw/aa bb/], 'Add complex document');
-ok_index_2($index, {
+ok_index($index, {
id => 3,
author => 'Arthur'
} => [qw/aa bb cc/], 'Add complex document');
-ok_index_2($index, {
+ok_index($index, {
id => 1,
author => 'Bob'
} => [qw/aa bb cc/], 'Add complex document');
diff --git a/t/result/segment/aggregate_facets.t b/t/result/segment/aggregate_facets.t
index 501b9fe..679a39a 100644
--- a/t/result/segment/aggregate_facets.t
+++ b/t/result/segment/aggregate_facets.t
@@ -9,32 +9,32 @@
# Create some documents
my $index = Krawfish::Index->new;
-ok_index_2($index, {
+ok_index($index, {
id => 2,
author => 'Peter',
genre => 'novel',
age => 4
} => [qw/aa bb/], 'Add complex document');
-ok_index_2($index, {
+ok_index($index, {
id => 3,
author => 'Peter',
genre => 'novel',
age => 3
} => [qw/aa bb/], 'Add complex document');
-ok_index_2($index, {
+ok_index($index, {
id => 5,
author => 'Peter',
genre => 'newsletter',
title => 'Your way to success!',
age => 4
} => [qw/aa bb aa/], 'Add complex document');
-ok_index_2($index, {
+ok_index($index, {
id => 6,
author => 'Fritz',
genre => 'newsletter',
age => 3
} => [qw/bb/], 'Add complex document');
-ok_index_2($index, {
+ok_index($index, {
id => 7,
author => 'Michael',
genre => 'newsletter',
diff --git a/t/result/segment/aggregate_freq.t b/t/result/segment/aggregate_freq.t
index b88200a..16bf672 100644
--- a/t/result/segment/aggregate_freq.t
+++ b/t/result/segment/aggregate_freq.t
@@ -8,13 +8,13 @@
my $index = Krawfish::Index->new;
-ok_index_2($index, {
+ok_index($index, {
id => 7
} => [qw/aa bb/], 'Add complex document');
-ok_index_2($index, {
+ok_index($index, {
id => 3,
} => [qw/aa cc cc/], 'Add complex document');
-ok_index_2($index, {
+ok_index($index, {
id => 1,
} => [qw/aa bb/], 'Add complex document');
diff --git a/t/result/segment/aggregate_length.t b/t/result/segment/aggregate_length.t
index 0fd7e9a..3c6fb6a 100644
--- a/t/result/segment/aggregate_length.t
+++ b/t/result/segment/aggregate_length.t
@@ -8,13 +8,13 @@
my $index = Krawfish::Index->new;
-ok_index_2($index, {
+ok_index($index, {
id => 7
} => '<1:s>[Der][hey]</1>', 'Add complex document');
-ok_index_2($index, {
+ok_index($index, {
id => 3,
} => '<1:s>[Der]</1>[Baum]', 'Add complex document');
-ok_index_2($index, {
+ok_index($index, {
id => 1,
} => '<1:s>[Der]</1><2:s>[alte][graue][Baum]</2>', 'Add complex document');
diff --git a/t/result/segment/aggregate_values.t b/t/result/segment/aggregate_values.t
index f857994..5112508 100644
--- a/t/result/segment/aggregate_values.t
+++ b/t/result/segment/aggregate_values.t
@@ -8,15 +8,15 @@
my $index = Krawfish::Index->new;
-ok_index_2($index, {
+ok_index($index, {
integer_id => 7,
integer_size => 2,
} => [qw/aa bb/], 'Add complex document');
-ok_index_2($index, {
+ok_index($index, {
integer_id => 3,
integer_size => 3,
} => [qw/aa cc cc/], 'Add complex document');
-ok_index_2($index, {
+ok_index($index, {
integer_id => 1,
integer_size => 2,
} => [qw/aa bb/], 'Add complex document');
diff --git a/t/result/segment/enrich_fields.t b/t/result/segment/enrich_fields.t
index 209b7ab..3defcc8 100644
--- a/t/result/segment/enrich_fields.t
+++ b/t/result/segment/enrich_fields.t
@@ -7,18 +7,18 @@
use_ok('Krawfish::Koral');
my $index = Krawfish::Index->new;
-ok_index_2($index, {
+ok_index($index, {
id => 'doc-1',
license => 'free',
corpus => 'corpus-2'
} => [qw/aa bb/], 'Add new document');
-ok_index_2($index, {
+ok_index($index, {
id => 'doc-2',
license => 'closed',
corpus => 'corpus-3'
} => [qw/aa bb/], 'Add new document');
-ok_index_2($index, {
+ok_index($index, {
id => 'doc-3',
license => 'free',
corpus => 'corpus-1'
diff --git a/t/result/segment/enrich_snippet.t b/t/result/segment/enrich_snippet.t
index ed6f186..33dc4e7 100644
--- a/t/result/segment/enrich_snippet.t
+++ b/t/result/segment/enrich_snippet.t
@@ -7,7 +7,7 @@
use_ok('Krawfish::Koral');
my $index = Krawfish::Index->new;
-ok_index_2($index, {
+ok_index($index, {
id => 'doc-1',
license => 'free',
corpus => 'corpus-2'
diff --git a/t/result/sort.t b/t/result/sort.t
index faded64..204f9f9 100644
--- a/t/result/sort.t
+++ b/t/result/sort.t
@@ -8,15 +8,15 @@
my $index = Krawfish::Index->new;
-ok_index_2($index, {
+ok_index($index, {
id => 7,
author => 'Carol'
} => [qw/aa bb/], 'Add complex document');
-ok_index_2($index, {
+ok_index($index, {
id => 3,
author => 'Arthur'
} => [qw/aa bb cc/], 'Add complex document');
-ok_index_2($index, {
+ok_index($index, {
id => 1,
author => 'Bob'
} => [qw/aa bb cc/], 'Add complex document');
diff --git a/t/result/sort_priority.t b/t/result/sort_priority.t
index bd7e7e6..1d29f11 100644
--- a/t/result/sort_priority.t
+++ b/t/result/sort_priority.t
@@ -9,15 +9,15 @@
my $index = Krawfish::Index->new;
-ok_index_2($index, {
+ok_index($index, {
docID => 7,
author => 'Carol'
} => [qw/aa bb/], 'Add complex document');
-ok_index_2($index, {
+ok_index($index, {
docID => 3,
author => 'Arthur'
} => [qw/aa bb cc/], 'Add complex document');
-ok_index_2($index, {
+ok_index($index, {
docID => 1,
author => 'Bob'
} => [qw/aa bb cc/], 'Add complex document');
diff --git a/t/result/sort_priority_cascade.t b/t/result/sort_priority_cascade.t
index 57bb1f0..1e5ca41 100644
--- a/t/result/sort_priority_cascade.t
+++ b/t/result/sort_priority_cascade.t
@@ -10,15 +10,15 @@
my $index = Krawfish::Index->new;
-ok_index_2($index, {
+ok_index($index, {
docID => 7,
author => 'Arthur'
} => [qw/aa bb/], 'Add complex document');
-ok_index_2($index, {
+ok_index($index, {
docID => 3,
author => 'Arthur'
} => [qw/aa bb cc/], 'Add complex document');
-ok_index_2($index, {
+ok_index($index, {
docID => 1,
author => 'Bob'
} => [qw/aa bb cc/], 'Add complex document');