Rename Meta to Compile
Change-Id: Ief55855e2642a64672a840ece9d9fd876a49d373
diff --git a/lib/Krawfish/Meta.pm b/lib/Krawfish/Compile.pm
similarity index 97%
rename from lib/Krawfish/Meta.pm
rename to lib/Krawfish/Compile.pm
index b67ca69..7848cc5 100644
--- a/lib/Krawfish/Meta.pm
+++ b/lib/Krawfish/Compile.pm
@@ -1,4 +1,4 @@
-package Krawfish::Meta;
+package Krawfish::Compile;
use parent 'Krawfish::Query';
use Krawfish::Koral::Result::Match;
use Krawfish::Log;
diff --git a/lib/Krawfish/Meta/Cluster/EnrichGroup/Calc.pm b/lib/Krawfish/Compile/Cluster/EnrichGroup/Calc.pm
similarity index 100%
rename from lib/Krawfish/Meta/Cluster/EnrichGroup/Calc.pm
rename to lib/Krawfish/Compile/Cluster/EnrichGroup/Calc.pm
diff --git a/lib/Krawfish/Meta/Cluster/Limit.pm b/lib/Krawfish/Compile/Cluster/Limit.pm
similarity index 94%
rename from lib/Krawfish/Meta/Cluster/Limit.pm
rename to lib/Krawfish/Compile/Cluster/Limit.pm
index 841d47a..c87a1bd 100644
--- a/lib/Krawfish/Meta/Cluster/Limit.pm
+++ b/lib/Krawfish/Compile/Cluster/Limit.pm
@@ -1,5 +1,5 @@
-package Krawfish::Meta::Cluster::Limit;
-use parent 'Krawfish::Meta';
+package Krawfish::Compile::Cluster::Limit;
+use parent 'Krawfish::Compile';
use Krawfish::Log;
use strict;
use warnings;
diff --git a/lib/Krawfish/Meta/Cluster/Sort.pm b/lib/Krawfish/Compile/Cluster/Sort.pm
similarity index 100%
rename from lib/Krawfish/Meta/Cluster/Sort.pm
rename to lib/Krawfish/Compile/Cluster/Sort.pm
diff --git a/lib/Krawfish/Meta/Node.pm b/lib/Krawfish/Compile/Node.pm
similarity index 97%
rename from lib/Krawfish/Meta/Node.pm
rename to lib/Krawfish/Compile/Node.pm
index 988eaf0..f913ecb 100644
--- a/lib/Krawfish/Meta/Node.pm
+++ b/lib/Krawfish/Compile/Node.pm
@@ -1,4 +1,4 @@
-package Krawfish::Meta::Node;
+package Krawfish::Compile::Node;
use strict;
use warnings;
@@ -23,7 +23,7 @@
# Building a merge sorting buffer
- $self->{buffer} = Krawfish::Meta::Node::SortingBuffer->new(
+ $self->{buffer} = Krawfish::Compile::Node::SortingBuffer->new(
scalar @{$self->{indexes}}, # Size of the buffer
$self->{sorting} # Criteria for sorting
);
diff --git a/lib/Krawfish/Meta/Node/Aggregate.pm b/lib/Krawfish/Compile/Node/Aggregate.pm
similarity index 95%
rename from lib/Krawfish/Meta/Node/Aggregate.pm
rename to lib/Krawfish/Compile/Node/Aggregate.pm
index 0595778..57f73e7 100644
--- a/lib/Krawfish/Meta/Node/Aggregate.pm
+++ b/lib/Krawfish/Compile/Node/Aggregate.pm
@@ -1,5 +1,5 @@
-package Krawfish::Meta::Node::Aggregate;
-use parent 'Krawfish::Meta::Node';
+package Krawfish::Compile::Node::Aggregate;
+use parent 'Krawfish::Compile::Node';
use strict;
use warnings;
diff --git a/lib/Krawfish/Meta/Node/Enrich/Fields.pm b/lib/Krawfish/Compile/Node/Enrich/Fields.pm
similarity index 93%
rename from lib/Krawfish/Meta/Node/Enrich/Fields.pm
rename to lib/Krawfish/Compile/Node/Enrich/Fields.pm
index c89aa40..e50b438 100644
--- a/lib/Krawfish/Meta/Node/Enrich/Fields.pm
+++ b/lib/Krawfish/Compile/Node/Enrich/Fields.pm
@@ -1,4 +1,4 @@
-package Krawfish::Meta::Node::Enrich::Fields;
+package Krawfish::Compile::Node::Enrich::Fields;
use parent 'Krawfish::Query';
use Krawfish::Util::String qw/squote/;
use strict;
diff --git a/lib/Krawfish/Meta/Node/Sort.pm b/lib/Krawfish/Compile/Node/Sort.pm
similarity index 97%
rename from lib/Krawfish/Meta/Node/Sort.pm
rename to lib/Krawfish/Compile/Node/Sort.pm
index 3df31ae..1fbf950 100644
--- a/lib/Krawfish/Meta/Node/Sort.pm
+++ b/lib/Krawfish/Compile/Node/Sort.pm
@@ -1,4 +1,4 @@
-package Krawfish::Meta::Node::Sort;
+package Krawfish::Compile::Node::Sort;
use Krawfish::Util::Heap;
use strict;
use warnings;
diff --git a/lib/Krawfish/Meta/Remote/Sort.pm b/lib/Krawfish/Compile/Remote/Sort.pm
similarity index 93%
rename from lib/Krawfish/Meta/Remote/Sort.pm
rename to lib/Krawfish/Compile/Remote/Sort.pm
index 5a196e3..660f4e0 100644
--- a/lib/Krawfish/Meta/Remote/Sort.pm
+++ b/lib/Krawfish/Compile/Remote/Sort.pm
@@ -1,4 +1,4 @@
-package Krawfish::Meta::Remote::Sort;
+package Krawfish::Compile::Remote::Sort;
use Krawfish::Log;
use strict;
use warnings;
diff --git a/lib/Krawfish/Meta/Segment/Aggregate.pm b/lib/Krawfish/Compile/Segment/Aggregate.pm
similarity index 95%
rename from lib/Krawfish/Meta/Segment/Aggregate.pm
rename to lib/Krawfish/Compile/Segment/Aggregate.pm
index 49e6b39..0ad04fc 100644
--- a/lib/Krawfish/Meta/Segment/Aggregate.pm
+++ b/lib/Krawfish/Compile/Segment/Aggregate.pm
@@ -1,9 +1,9 @@
-package Krawfish::Meta::Segment::Aggregate;
-use parent 'Krawfish::Meta';
+package Krawfish::Compile::Segment::Aggregate;
+use parent 'Krawfish::Compile';
use strict;
use warnings;
-use constant DEBUG => 1;
+use constant DEBUG => 0;
# TODO:
# It may be better to have one aggregator per match
diff --git a/lib/Krawfish/Meta/Segment/Aggregate/Base.pm b/lib/Krawfish/Compile/Segment/Aggregate/Base.pm
similarity index 86%
rename from lib/Krawfish/Meta/Segment/Aggregate/Base.pm
rename to lib/Krawfish/Compile/Segment/Aggregate/Base.pm
index c9e1d88..efc4278 100644
--- a/lib/Krawfish/Meta/Segment/Aggregate/Base.pm
+++ b/lib/Krawfish/Compile/Segment/Aggregate/Base.pm
@@ -1,4 +1,4 @@
-package Krawfish::Meta::Segment::Aggregate::Base;
+package Krawfish::Compile::Segment::Aggregate::Base;
use strict;
use warnings;
diff --git a/lib/Krawfish/Meta/Segment/Aggregate/Fields.pm b/lib/Krawfish/Compile/Segment/Aggregate/Fields.pm
similarity index 95%
rename from lib/Krawfish/Meta/Segment/Aggregate/Fields.pm
rename to lib/Krawfish/Compile/Segment/Aggregate/Fields.pm
index eec4215..2887f70 100644
--- a/lib/Krawfish/Meta/Segment/Aggregate/Fields.pm
+++ b/lib/Krawfish/Compile/Segment/Aggregate/Fields.pm
@@ -1,12 +1,12 @@
-package Krawfish::Meta::Segment::Aggregate::Fields;
-use parent 'Krawfish::Meta::Segment::Aggregate::Base';
+package Krawfish::Compile::Segment::Aggregate::Fields;
+use parent 'Krawfish::Compile::Segment::Aggregate::Base';
use Krawfish::Koral::Result::Aggregate::Fields;
use Krawfish::Util::String qw/squote/;
use Krawfish::Log;
use strict;
use warnings;
-use constant DEBUG => 1;
+use constant DEBUG => 0;
# TODO:
diff --git a/lib/Krawfish/Meta/Segment/Aggregate/Frequencies.pm b/lib/Krawfish/Compile/Segment/Aggregate/Frequencies.pm
similarity index 76%
rename from lib/Krawfish/Meta/Segment/Aggregate/Frequencies.pm
rename to lib/Krawfish/Compile/Segment/Aggregate/Frequencies.pm
index f225b72..099c092 100644
--- a/lib/Krawfish/Meta/Segment/Aggregate/Frequencies.pm
+++ b/lib/Krawfish/Compile/Segment/Aggregate/Frequencies.pm
@@ -1,5 +1,5 @@
-package Krawfish::Meta::Segment::Aggregate::Frequencies;
-use parent 'Krawfish::Meta::Segment::Aggregate::Base';
+package Krawfish::Compile::Segment::Aggregate::Frequencies;
+use parent 'Krawfish::Compile::Segment::Aggregate::Base';
use Krawfish::Log;
use strict;
use warnings;
diff --git a/lib/Krawfish/Meta/Segment/Aggregate/Length.pm b/lib/Krawfish/Compile/Segment/Aggregate/Length.pm
similarity index 90%
rename from lib/Krawfish/Meta/Segment/Aggregate/Length.pm
rename to lib/Krawfish/Compile/Segment/Aggregate/Length.pm
index ef92dec..87f9274 100644
--- a/lib/Krawfish/Meta/Segment/Aggregate/Length.pm
+++ b/lib/Krawfish/Compile/Segment/Aggregate/Length.pm
@@ -1,5 +1,5 @@
-package Krawfish::Meta::Segment::Aggregate::Length;
-use parent 'Krawfish::Meta::Segment::Aggregate::Base';
+package Krawfish::Compile::Segment::Aggregate::Length;
+use parent 'Krawfish::Compile::Segment::Aggregate::Base';
use Krawfish::Log;
use strict;
use warnings;
diff --git a/lib/Krawfish/Meta/Segment/Aggregate/TermExistence.pm b/lib/Krawfish/Compile/Segment/Aggregate/TermExistence.pm
similarity index 100%
rename from lib/Krawfish/Meta/Segment/Aggregate/TermExistence.pm
rename to lib/Krawfish/Compile/Segment/Aggregate/TermExistence.pm
diff --git a/lib/Krawfish/Meta/Segment/Aggregate/TermFreq.pm b/lib/Krawfish/Compile/Segment/Aggregate/TermFreq.pm
similarity index 91%
rename from lib/Krawfish/Meta/Segment/Aggregate/TermFreq.pm
rename to lib/Krawfish/Compile/Segment/Aggregate/TermFreq.pm
index 3ac987b..d76ebe3 100644
--- a/lib/Krawfish/Meta/Segment/Aggregate/TermFreq.pm
+++ b/lib/Krawfish/Compile/Segment/Aggregate/TermFreq.pm
@@ -1,5 +1,5 @@
-package Krawfish::Meta::Segment::Aggregate::TermFreq;
-use parent 'Krawfish::Meta::Segment::Aggregate::Base';
+package Krawfish::Compile::Segment::Aggregate::TermFreq;
+use parent 'Krawfish::Compile::Segment::Aggregate::Base';
use Krawfish::Util::String qw/squote/;
use Krawfish::Log;
use strict;
diff --git a/lib/Krawfish/Meta/Segment/Aggregate/TokenFreq.pm b/lib/Krawfish/Compile/Segment/Aggregate/TokenFreq.pm
similarity index 100%
rename from lib/Krawfish/Meta/Segment/Aggregate/TokenFreq.pm
rename to lib/Krawfish/Compile/Segment/Aggregate/TokenFreq.pm
diff --git a/lib/Krawfish/Meta/Segment/Aggregate/Values.pm b/lib/Krawfish/Compile/Segment/Aggregate/Values.pm
similarity index 93%
rename from lib/Krawfish/Meta/Segment/Aggregate/Values.pm
rename to lib/Krawfish/Compile/Segment/Aggregate/Values.pm
index 9523887..71b0711 100644
--- a/lib/Krawfish/Meta/Segment/Aggregate/Values.pm
+++ b/lib/Krawfish/Compile/Segment/Aggregate/Values.pm
@@ -1,5 +1,5 @@
-package Krawfish::Meta::Segment::Aggregate::Values;
-use parent 'Krawfish::Meta::Segment::Aggregate::Base';
+package Krawfish::Compile::Segment::Aggregate::Values;
+use parent 'Krawfish::Compile::Segment::Aggregate::Base';
use Krawfish::Koral::Result::Aggregate::Values;
use Krawfish::Log;
use strict;
@@ -16,7 +16,7 @@
# An aggregation on groups!
use constant {
- DEBUG => 1
+ DEBUG => 0
};
sub new {
diff --git a/lib/Krawfish/Meta/Segment/Bundle.pm b/lib/Krawfish/Compile/Segment/Bundle.pm
similarity index 94%
rename from lib/Krawfish/Meta/Segment/Bundle.pm
rename to lib/Krawfish/Compile/Segment/Bundle.pm
index 8ee22b6..6336697 100644
--- a/lib/Krawfish/Meta/Segment/Bundle.pm
+++ b/lib/Krawfish/Compile/Segment/Bundle.pm
@@ -1,5 +1,5 @@
-package Krawfish::Meta::Segment::Bundle;
-use parent 'Krawfish::Meta';
+package Krawfish::Compile::Segment::Bundle;
+use parent 'Krawfish::Compile';
use Krawfish::Log;
use strict;
use warnings;
@@ -9,7 +9,7 @@
# (or bundles of bundles of postings) sorted by a certain criterion.
-use constant DEBUG => 1;
+use constant DEBUG => 0;
# Bundle the current match
diff --git a/lib/Krawfish/Meta/Segment/BundleDocs.pm b/lib/Krawfish/Compile/Segment/BundleDocs.pm
similarity index 94%
rename from lib/Krawfish/Meta/Segment/BundleDocs.pm
rename to lib/Krawfish/Compile/Segment/BundleDocs.pm
index 78b913c..db13935 100644
--- a/lib/Krawfish/Meta/Segment/BundleDocs.pm
+++ b/lib/Krawfish/Compile/Segment/BundleDocs.pm
@@ -1,5 +1,5 @@
-package Krawfish::Meta::Segment::BundleDocs;
-use parent 'Krawfish::Meta::Segment::Bundle';
+package Krawfish::Compile::Segment::BundleDocs;
+use parent 'Krawfish::Compile::Segment::Bundle';
use Krawfish::Log;
use Krawfish::Posting::List;
use strict;
@@ -12,7 +12,7 @@
# will bundle the next doc - without asking if the doc
# is relevant.
-use constant DEBUG => 1;
+use constant DEBUG => 0;
sub new {
my $class = shift;
diff --git a/lib/Krawfish/Meta/Segment/Enrich/Context.pm b/lib/Krawfish/Compile/Segment/Enrich/Context.pm
similarity index 94%
rename from lib/Krawfish/Meta/Segment/Enrich/Context.pm
rename to lib/Krawfish/Compile/Segment/Enrich/Context.pm
index 600138e..09feebd 100644
--- a/lib/Krawfish/Meta/Segment/Enrich/Context.pm
+++ b/lib/Krawfish/Compile/Segment/Enrich/Context.pm
@@ -1,10 +1,10 @@
-package Krawfish::Meta::Segment::Enrich::Context;
-use parent 'Krawfish::Meta';
+package Krawfish::Compile::Segment::Enrich::Context;
+use parent 'Krawfish::Compile';
use Krawfish::Log;
use strict;
use warnings;
-use constant DEBUG => 1;
+use constant DEBUG => 0;
# DEPRECATED!!!
diff --git a/lib/Krawfish/Meta/Segment/Enrich/Fields.pm b/lib/Krawfish/Compile/Segment/Enrich/Fields.pm
similarity index 95%
rename from lib/Krawfish/Meta/Segment/Enrich/Fields.pm
rename to lib/Krawfish/Compile/Segment/Enrich/Fields.pm
index b85f066..a201418 100644
--- a/lib/Krawfish/Meta/Segment/Enrich/Fields.pm
+++ b/lib/Krawfish/Compile/Segment/Enrich/Fields.pm
@@ -1,11 +1,11 @@
-package Krawfish::Meta::Segment::Enrich::Fields;
-use parent 'Krawfish::Meta';
+package Krawfish::Compile::Segment::Enrich::Fields;
+use parent 'Krawfish::Compile';
use Krawfish::Koral::Result::Enrich::Fields;
use Krawfish::Log;
use strict;
use warnings;
-use constant DEBUG => 1;
+use constant DEBUG => 0;
# This will enrich each match with specific field information
# Needs to be called on the segment level
diff --git a/lib/Krawfish/Meta/Segment/Enrich/Snippet.pm b/lib/Krawfish/Compile/Segment/Enrich/Snippet.pm
similarity index 92%
rename from lib/Krawfish/Meta/Segment/Enrich/Snippet.pm
rename to lib/Krawfish/Compile/Segment/Enrich/Snippet.pm
index ec2ea4b..8de0052 100644
--- a/lib/Krawfish/Meta/Segment/Enrich/Snippet.pm
+++ b/lib/Krawfish/Compile/Segment/Enrich/Snippet.pm
@@ -1,12 +1,12 @@
-package Krawfish::Meta::Segment::Enrich::Snippet;
-use parent 'Krawfish::Meta';
+package Krawfish::Compile::Segment::Enrich::Snippet;
+use parent 'Krawfish::Compile';
use Krawfish::Koral::Result::Enrich::Snippet;
-# use Krawfish::Meta::Segment::Enrich::Snippet::Highlights;
+# use Krawfish::Compile::Segment::Enrich::Snippet::Highlights;
use Krawfish::Log;
use strict;
use warnings;
-use constant DEBUG => 1;
+use constant DEBUG => 0;
# TODO:
# It may be more efficient to first collect all required
diff --git a/lib/Krawfish/Meta/Segment/Enrich/Snippet/Context.pm b/lib/Krawfish/Compile/Segment/Enrich/Snippet/Context.pm
similarity index 100%
rename from lib/Krawfish/Meta/Segment/Enrich/Snippet/Context.pm
rename to lib/Krawfish/Compile/Segment/Enrich/Snippet/Context.pm
diff --git a/lib/Krawfish/Meta/Segment/Enrich/Snippet/Context/Span.pm b/lib/Krawfish/Compile/Segment/Enrich/Snippet/Context/Span.pm
similarity index 97%
rename from lib/Krawfish/Meta/Segment/Enrich/Snippet/Context/Span.pm
rename to lib/Krawfish/Compile/Segment/Enrich/Snippet/Context/Span.pm
index db955ff..4ebd8ce 100644
--- a/lib/Krawfish/Meta/Segment/Enrich/Snippet/Context/Span.pm
+++ b/lib/Krawfish/Compile/Segment/Enrich/Snippet/Context/Span.pm
@@ -1,4 +1,4 @@
-package Krawfish::Meta::Segment::Enrich::Snippet::Context::Span;
+package Krawfish::Compile::Segment::Enrich::Snippet::Context::Span;
use Krawfish::Posting::Forward;
use strict;
use warnings;
diff --git a/lib/Krawfish/Meta/Segment/Enrich/Snippet/Element.pm b/lib/Krawfish/Compile/Segment/Enrich/Snippet/Element.pm
similarity index 75%
rename from lib/Krawfish/Meta/Segment/Enrich/Snippet/Element.pm
rename to lib/Krawfish/Compile/Segment/Enrich/Snippet/Element.pm
index e2d1514..163213a 100644
--- a/lib/Krawfish/Meta/Segment/Enrich/Snippet/Element.pm
+++ b/lib/Krawfish/Compile/Segment/Enrich/Snippet/Element.pm
@@ -1,4 +1,4 @@
-package Krawfish::Meta::Segment::Snippet::Element;
+package Krawfish::Compile::Segment::Snippet::Element;
use Krawfish::Log;
use strict;
use warnings;
diff --git a/lib/Krawfish/Meta/Segment/Enrich/Snippet/Element/Pagebreak.pm b/lib/Krawfish/Compile/Segment/Enrich/Snippet/Element/Pagebreak.pm
similarity index 72%
rename from lib/Krawfish/Meta/Segment/Enrich/Snippet/Element/Pagebreak.pm
rename to lib/Krawfish/Compile/Segment/Enrich/Snippet/Element/Pagebreak.pm
index e02ba4c..036d69d 100644
--- a/lib/Krawfish/Meta/Segment/Enrich/Snippet/Element/Pagebreak.pm
+++ b/lib/Krawfish/Compile/Segment/Enrich/Snippet/Element/Pagebreak.pm
@@ -1,5 +1,5 @@
-package Krawfish::Meta::Segment::Enrich::Snippet::Element::Pagebreak;
-use parent 'Krawfish::Meta::Segment::Enrich::Snippet::Element';
+package Krawfish::Compile::Segment::Enrich::Snippet::Element::Pagebreak;
+use parent 'Krawfish::Compile::Segment::Enrich::Snippet::Element';
use strict;
use warnings;
diff --git a/lib/Krawfish/Meta/Segment/Enrich/Snippet/Highlights.pm b/lib/Krawfish/Compile/Segment/Enrich/Snippet/Highlights.pm
similarity index 99%
rename from lib/Krawfish/Meta/Segment/Enrich/Snippet/Highlights.pm
rename to lib/Krawfish/Compile/Segment/Enrich/Snippet/Highlights.pm
index e758e28..0f8bfb3 100644
--- a/lib/Krawfish/Meta/Segment/Enrich/Snippet/Highlights.pm
+++ b/lib/Krawfish/Compile/Segment/Enrich/Snippet/Highlights.pm
@@ -1,4 +1,4 @@
-package Krawfish::Meta::Segment::Enrich::Snippet::Highlights;
+package Krawfish::Compile::Segment::Enrich::Snippet::Highlights;
use Krawfish::Log;
use strict;
use warnings;
diff --git a/lib/Krawfish/Meta/Segment/Enrich/Snippet/Hit.pm b/lib/Krawfish/Compile/Segment/Enrich/Snippet/Hit.pm
similarity index 91%
rename from lib/Krawfish/Meta/Segment/Enrich/Snippet/Hit.pm
rename to lib/Krawfish/Compile/Segment/Enrich/Snippet/Hit.pm
index 04a6583..a22fd95 100644
--- a/lib/Krawfish/Meta/Segment/Enrich/Snippet/Hit.pm
+++ b/lib/Krawfish/Compile/Segment/Enrich/Snippet/Hit.pm
@@ -1,10 +1,10 @@
-package Krawfish::Meta::Segment::Enrich::Snippet::Hit;
+package Krawfish::Compile::Segment::Enrich::Snippet::Hit;
use Krawfish::Koral::Document::Subtoken;
use Krawfish::Log;
use strict;
use warnings;
-use constant DEBUG => 1;
+use constant DEBUG => 0;
sub new {
my $class = shift;
diff --git a/lib/Krawfish/Meta/Segment/Enrich/Snippet/Spans.pm b/lib/Krawfish/Compile/Segment/Enrich/Snippet/Spans.pm
similarity index 86%
rename from lib/Krawfish/Meta/Segment/Enrich/Snippet/Spans.pm
rename to lib/Krawfish/Compile/Segment/Enrich/Snippet/Spans.pm
index 9d4988b..f7ad380 100644
--- a/lib/Krawfish/Meta/Segment/Enrich/Snippet/Spans.pm
+++ b/lib/Krawfish/Compile/Segment/Enrich/Snippet/Spans.pm
@@ -1,4 +1,4 @@
-package Krawfish::Meta::Segment::Enrich::Snippet::Spans;
+package Krawfish::Compile::Segment::Enrich::Snippet::Spans;
use Krawfish::Log;
use strict;
use warnings;
diff --git a/lib/Krawfish/Meta/Segment/Enrich/SortCriterion.pm b/lib/Krawfish/Compile/Segment/Enrich/SortCriterion.pm
similarity index 95%
rename from lib/Krawfish/Meta/Segment/Enrich/SortCriterion.pm
rename to lib/Krawfish/Compile/Segment/Enrich/SortCriterion.pm
index fefb287..b388f0e 100644
--- a/lib/Krawfish/Meta/Segment/Enrich/SortCriterion.pm
+++ b/lib/Krawfish/Compile/Segment/Enrich/SortCriterion.pm
@@ -1,5 +1,5 @@
-package Krawfish::Meta::Segment::Enrich::SortCriterion;
-use parent 'Krawfish::Meta';
+package Krawfish::Compile::Segment::Enrich::SortCriterion;
+use parent 'Krawfish::Compile';
use warnings;
use strict;
diff --git a/lib/Krawfish/Meta/Segment/Enrich/TermFreq.pm b/lib/Krawfish/Compile/Segment/Enrich/TermFreq.pm
similarity index 100%
rename from lib/Krawfish/Meta/Segment/Enrich/TermFreq.pm
rename to lib/Krawfish/Compile/Segment/Enrich/TermFreq.pm
diff --git a/lib/Krawfish/Meta/Segment/Enrich/Terms.pm b/lib/Krawfish/Compile/Segment/Enrich/Terms.pm
similarity index 95%
rename from lib/Krawfish/Meta/Segment/Enrich/Terms.pm
rename to lib/Krawfish/Compile/Segment/Enrich/Terms.pm
index 0076566..a5299a0 100644
--- a/lib/Krawfish/Meta/Segment/Enrich/Terms.pm
+++ b/lib/Krawfish/Compile/Segment/Enrich/Terms.pm
@@ -1,6 +1,6 @@
-package Krawfish::Meta::Segment::Enrich::Terms;
+package Krawfish::Compile::Segment::Enrich::Terms;
use Krawfish::Koral::Result::Enrich::Terms;
-use parent 'Krawfish::Meta';
+use parent 'Krawfish::Compile';
use Krawfish::Log;
use strict;
use warnings;
@@ -12,8 +12,8 @@
# for a specific class
# TODO:
-# Make this usable for Krawfish::Meta::Group::Classes
-# and Krawfish::Meta::Sort::Classes
+# Make this usable for Krawfish::Compile::Group::Classes
+# and Krawfish::Compile::Sort::Classes
# by supporting $nrs instead of $nr
#
# TODO:
@@ -29,7 +29,7 @@
# For sorting it's important to remember that!
use constant {
- DEBUG => 1,
+ DEBUG => 0,
NR => 0,
START_POS => 1,
END_POS => 2,
diff --git a/lib/Krawfish/Meta/Segment/EnrichGroup/Values.pm b/lib/Krawfish/Compile/Segment/EnrichGroup/Values.pm
similarity index 100%
rename from lib/Krawfish/Meta/Segment/EnrichGroup/Values.pm
rename to lib/Krawfish/Compile/Segment/EnrichGroup/Values.pm
diff --git a/lib/Krawfish/Meta/Segment/Group/AnnotationClasses.pm b/lib/Krawfish/Compile/Segment/Group/AnnotationClasses.pm
similarity index 100%
rename from lib/Krawfish/Meta/Segment/Group/AnnotationClasses.pm
rename to lib/Krawfish/Compile/Segment/Group/AnnotationClasses.pm
diff --git a/lib/Krawfish/Meta/Segment/Group/Characters.pm b/lib/Krawfish/Compile/Segment/Group/Characters.pm
similarity index 96%
rename from lib/Krawfish/Meta/Segment/Group/Characters.pm
rename to lib/Krawfish/Compile/Segment/Group/Characters.pm
index 0594f17..e5b1da7 100644
--- a/lib/Krawfish/Meta/Segment/Group/Characters.pm
+++ b/lib/Krawfish/Compile/Segment/Group/Characters.pm
@@ -1,4 +1,4 @@
-package Krawfish::Meta::Segment::Group::Character;
+package Krawfish::Compile::Segment::Group::Character;
use Krawfish::Log;
use strict;
use warnings;
diff --git a/lib/Krawfish/Meta/Segment/Group/ClassFrequencies.pm b/lib/Krawfish/Compile/Segment/Group/ClassFrequencies.pm
similarity index 97%
rename from lib/Krawfish/Meta/Segment/Group/ClassFrequencies.pm
rename to lib/Krawfish/Compile/Segment/Group/ClassFrequencies.pm
index b14958c..529267f 100644
--- a/lib/Krawfish/Meta/Segment/Group/ClassFrequencies.pm
+++ b/lib/Krawfish/Compile/Segment/Group/ClassFrequencies.pm
@@ -1,11 +1,11 @@
-package Krawfish::Meta::Segment::Group::ClassFrequencies;
-use parent 'Krawfish::Meta';
+package Krawfish::Compile::Segment::Group::ClassFrequencies;
+use parent 'Krawfish::Compile';
use Krawfish::Koral::Result::Group::ClassFrequencies;
use Krawfish::Log;
use strict;
use warnings;
-use constant DEBUG => 1;
+use constant DEBUG => 0;
# Aggregate by content information, for example,
# based on a certain class
diff --git a/lib/Krawfish/Meta/Segment/Group/Classes.pm b/lib/Krawfish/Compile/Segment/Group/Classes.pm
similarity index 95%
rename from lib/Krawfish/Meta/Segment/Group/Classes.pm
rename to lib/Krawfish/Compile/Segment/Group/Classes.pm
index c3c210e..af286ed 100644
--- a/lib/Krawfish/Meta/Segment/Group/Classes.pm
+++ b/lib/Krawfish/Compile/Segment/Group/Classes.pm
@@ -1,4 +1,4 @@
-package Krawfish::Meta::Segment::Group::Classes;
+package Krawfish::Compile::Segment::Group::Classes;
use Krawfish::Log;
use strict;
use warnings;
@@ -8,7 +8,7 @@
# group by surface terms.
# TODO:
-# Refer to Krawfish::Meta::Segment::TermIDs!
+# Refer to Krawfish::Compile::Segment::TermIDs!
use constant {
DEBUG => 0,
diff --git a/lib/Krawfish/Meta/Segment/Group/Fields.pm b/lib/Krawfish/Compile/Segment/Group/Fields.pm
similarity index 97%
rename from lib/Krawfish/Meta/Segment/Group/Fields.pm
rename to lib/Krawfish/Compile/Segment/Group/Fields.pm
index 9a37db4..75884b2 100644
--- a/lib/Krawfish/Meta/Segment/Group/Fields.pm
+++ b/lib/Krawfish/Compile/Segment/Group/Fields.pm
@@ -1,5 +1,5 @@
-package Krawfish::Meta::Segment::Group::Fields;
-use parent 'Krawfish::Meta';
+package Krawfish::Compile::Segment::Group::Fields;
+use parent 'Krawfish::Compile';
use Krawfish::Koral::Result::Group::Fields;
use Krawfish::Log;
use strict;
diff --git a/lib/Krawfish/Meta/Segment/Group/Spans.pm b/lib/Krawfish/Compile/Segment/Group/Spans.pm
similarity index 94%
rename from lib/Krawfish/Meta/Segment/Group/Spans.pm
rename to lib/Krawfish/Compile/Segment/Group/Spans.pm
index debaa69..7085162 100644
--- a/lib/Krawfish/Meta/Segment/Group/Spans.pm
+++ b/lib/Krawfish/Compile/Segment/Group/Spans.pm
@@ -1,5 +1,5 @@
-package Krawfish::Meta::Segment::Group::Spans;
-use parent 'Krawfish::Meta';
+package Krawfish::Compile::Segment::Group::Spans;
+use parent 'Krawfish::Compile';
use Krawfish::Log;
use strict;
use warnings;
diff --git a/lib/Krawfish/Meta/Segment/Group/TermExistence.pm b/lib/Krawfish/Compile/Segment/Group/TermExistence.pm
similarity index 96%
rename from lib/Krawfish/Meta/Segment/Group/TermExistence.pm
rename to lib/Krawfish/Compile/Segment/Group/TermExistence.pm
index 3570166..009c6ed 100644
--- a/lib/Krawfish/Meta/Segment/Group/TermExistence.pm
+++ b/lib/Krawfish/Compile/Segment/Group/TermExistence.pm
@@ -1,5 +1,5 @@
-package Krawfish::Meta::Segment::Group::TermExistence;
-use parent 'Krawfish::Meta';
+package Krawfish::Compile::Segment::Group::TermExistence;
+use parent 'Krawfish::Compile';
use strict;
use warnings;
diff --git a/lib/Krawfish/Meta/Segment/Sort.pm b/lib/Krawfish/Compile/Segment/Sort.pm
similarity index 97%
rename from lib/Krawfish/Meta/Segment/Sort.pm
rename to lib/Krawfish/Compile/Segment/Sort.pm
index 868fe45..3c69732 100644
--- a/lib/Krawfish/Meta/Segment/Sort.pm
+++ b/lib/Krawfish/Compile/Segment/Sort.pm
@@ -1,5 +1,5 @@
-package Krawfish::Meta::Segment::Sort;
-use parent 'Krawfish::Meta::Segment::Bundle';
+package Krawfish::Compile::Segment::Sort;
+use parent 'Krawfish::Compile::Segment::Bundle';
use Krawfish::Util::String qw/squote/;
use Krawfish::Util::PriorityQueue::PerDoc;
use Krawfish::Koral::Result::Match;
@@ -43,7 +43,7 @@
use constant {
- DEBUG => 1,
+ DEBUG => 0,
RANK => 0,
SAME => 1,
VALUE => 2,
@@ -65,7 +65,7 @@
#
my $query = $param{query};
- unless ($query->isa('Krawfish::Meta::Segment::Bundle')) {
+ unless ($query->isa('Krawfish::Compile::Segment::Bundle')) {
warn 'The query is no bundled query';
return;
};
diff --git a/lib/Krawfish/Meta/Segment/Sort/Alphabet.pm b/lib/Krawfish/Compile/Segment/Sort/Alphabet.pm
similarity index 96%
rename from lib/Krawfish/Meta/Segment/Sort/Alphabet.pm
rename to lib/Krawfish/Compile/Segment/Sort/Alphabet.pm
index bbdf3de..25d805f 100644
--- a/lib/Krawfish/Meta/Segment/Sort/Alphabet.pm
+++ b/lib/Krawfish/Compile/Segment/Sort/Alphabet.pm
@@ -1,4 +1,4 @@
-package Krawfish::Meta::Segment::Sort::Alphabet;
+package Krawfish::Compile::Segment::Sort::Alphabet;
use Krawfish::Log;
use strict;
use warnings;
diff --git a/lib/Krawfish/Meta/Segment/Sort/Criterion/Rank.pm b/lib/Krawfish/Compile/Segment/Sort/Criterion/Rank.pm
similarity index 93%
rename from lib/Krawfish/Meta/Segment/Sort/Criterion/Rank.pm
rename to lib/Krawfish/Compile/Segment/Sort/Criterion/Rank.pm
index 8b7247c..ac6710d 100644
--- a/lib/Krawfish/Meta/Segment/Sort/Criterion/Rank.pm
+++ b/lib/Krawfish/Compile/Segment/Sort/Criterion/Rank.pm
@@ -1,4 +1,4 @@
-package Krawfish::Meta::Sort::Criterion::Field;
+package Krawfish::Compile::Sort::Criterion::Field;
use strict;
use warnings;
diff --git a/lib/Krawfish/Meta/Segment/Sort/Field.pm b/lib/Krawfish/Compile/Segment/Sort/Field.pm
similarity index 95%
rename from lib/Krawfish/Meta/Segment/Sort/Field.pm
rename to lib/Krawfish/Compile/Segment/Sort/Field.pm
index 6649f2c..ac441e4 100644
--- a/lib/Krawfish/Meta/Segment/Sort/Field.pm
+++ b/lib/Krawfish/Compile/Segment/Sort/Field.pm
@@ -1,9 +1,9 @@
-package Krawfish::Meta::Segment::Sort::Field;
+package Krawfish::Compile::Segment::Sort::Field;
use Krawfish::Log;
use strict;
use warnings;
-use constant DEBUG => 1;
+use constant DEBUG => 0;
# TODO:
# Use this an instantiate it directly with
diff --git a/lib/Krawfish/Meta/Segment/Sort/Filter.pm b/lib/Krawfish/Compile/Segment/Sort/Filter.pm
similarity index 97%
rename from lib/Krawfish/Meta/Segment/Sort/Filter.pm
rename to lib/Krawfish/Compile/Segment/Sort/Filter.pm
index 1148071..9f723d9 100644
--- a/lib/Krawfish/Meta/Segment/Sort/Filter.pm
+++ b/lib/Krawfish/Compile/Segment/Sort/Filter.pm
@@ -1,4 +1,4 @@
-package Krawfish::Meta::Segment::Sort::Filter;
+package Krawfish::Compile::Segment::Sort::Filter;
use parent 'Krawfish::Corpus';
use Krawfish::Log;
use strict;
diff --git a/lib/Krawfish/Meta/Segment/Sort/No.pm b/lib/Krawfish/Compile/Segment/Sort/No.pm
similarity index 92%
rename from lib/Krawfish/Meta/Segment/Sort/No.pm
rename to lib/Krawfish/Compile/Segment/Sort/No.pm
index f4414b8..61f3b90 100644
--- a/lib/Krawfish/Meta/Segment/Sort/No.pm
+++ b/lib/Krawfish/Compile/Segment/Sort/No.pm
@@ -1,4 +1,4 @@
-package Krawfish::Meta::Segment::Sort::No;
+package Krawfish::Compile::Segment::Sort::No;
use strict;
use warnings;
diff --git a/lib/Krawfish/Meta/Segment/Sort/Priority.pm b/lib/Krawfish/Compile/Segment/Sort/Priority.pm
similarity index 97%
rename from lib/Krawfish/Meta/Segment/Sort/Priority.pm
rename to lib/Krawfish/Compile/Segment/Sort/Priority.pm
index 4acce0b..926676d 100644
--- a/lib/Krawfish/Meta/Segment/Sort/Priority.pm
+++ b/lib/Krawfish/Compile/Segment/Sort/Priority.pm
@@ -1,4 +1,4 @@
-package Krawfish::Meta::Segment::Sort::Priority;
+package Krawfish::Compile::Segment::Sort::Priority;
use Krawfish::Util::PriorityQueue;
use Krawfish::Log;
use Data::Dumper;
diff --git a/lib/Krawfish/Meta/Segment/Sort/PriorityCascade.pm b/lib/Krawfish/Compile/Segment/Sort/PriorityCascade.pm
similarity index 98%
rename from lib/Krawfish/Meta/Segment/Sort/PriorityCascade.pm
rename to lib/Krawfish/Compile/Segment/Sort/PriorityCascade.pm
index 31d5aa0..58806e4 100644
--- a/lib/Krawfish/Meta/Segment/Sort/PriorityCascade.pm
+++ b/lib/Krawfish/Compile/Segment/Sort/PriorityCascade.pm
@@ -1,5 +1,5 @@
-package Krawfish::Meta::Segment::Sort::PriorityCascade;
-use parent 'Krawfish::Meta';
+package Krawfish::Compile::Segment::Sort::PriorityCascade;
+use parent 'Krawfish::Compile';
use Krawfish::Util::String qw/squote/;
use Krawfish::Util::PriorityQueue::PerDoc;
use Krawfish::Koral::Result;
diff --git a/lib/Krawfish/Meta/Segment/Sort/Random.pm b/lib/Krawfish/Compile/Segment/Sort/Random.pm
similarity index 100%
rename from lib/Krawfish/Meta/Segment/Sort/Random.pm
rename to lib/Krawfish/Compile/Segment/Sort/Random.pm
diff --git a/lib/Krawfish/Meta/Segment/Sort/Sample.pm b/lib/Krawfish/Compile/Segment/Sort/Sample.pm
similarity index 98%
rename from lib/Krawfish/Meta/Segment/Sort/Sample.pm
rename to lib/Krawfish/Compile/Segment/Sort/Sample.pm
index 48466aa..674527e 100644
--- a/lib/Krawfish/Meta/Segment/Sort/Sample.pm
+++ b/lib/Krawfish/Compile/Segment/Sort/Sample.pm
@@ -1,4 +1,4 @@
-package Krawfish::Meta::Segment::Sort::Sample;
+package Krawfish::Compile::Segment::Sort::Sample;
use Krawfish::Koral::Result::Match;
use Krawfish::Log;
use strict;
diff --git a/lib/Krawfish/Meta/Segment/Sort/Simple.pm b/lib/Krawfish/Compile/Segment/Sort/Simple.pm
similarity index 96%
rename from lib/Krawfish/Meta/Segment/Sort/Simple.pm
rename to lib/Krawfish/Compile/Segment/Sort/Simple.pm
index 20f312f..5f438d2 100644
--- a/lib/Krawfish/Meta/Segment/Sort/Simple.pm
+++ b/lib/Krawfish/Compile/Segment/Sort/Simple.pm
@@ -1,4 +1,4 @@
-package Krawfish::Meta::Segment::Sort::Simple;
+package Krawfish::Compile::Segment::Sort::Simple;
use Krawfish::Log;
use strict;
use warnings;
diff --git a/lib/Krawfish/Meta/Segment/Sort/SubTerm.pm b/lib/Krawfish/Compile/Segment/Sort/SubTerm.pm
similarity index 96%
rename from lib/Krawfish/Meta/Segment/Sort/SubTerm.pm
rename to lib/Krawfish/Compile/Segment/Sort/SubTerm.pm
index e2e173b..dc79207 100644
--- a/lib/Krawfish/Meta/Segment/Sort/SubTerm.pm
+++ b/lib/Krawfish/Compile/Segment/Sort/SubTerm.pm
@@ -1,4 +1,4 @@
-package Krawfish::Meta::Segment::Sort::SubTerm;
+package Krawfish::Compile::Segment::Sort::SubTerm;
use strict;
use warnings;
diff --git a/lib/Krawfish/Meta/Segment/Sort/Substring.pm b/lib/Krawfish/Compile/Segment/Sort/Substring.pm
similarity index 94%
rename from lib/Krawfish/Meta/Segment/Sort/Substring.pm
rename to lib/Krawfish/Compile/Segment/Sort/Substring.pm
index bc6d70c..c20e454 100644
--- a/lib/Krawfish/Meta/Segment/Sort/Substring.pm
+++ b/lib/Krawfish/Compile/Segment/Sort/Substring.pm
@@ -1,4 +1,4 @@
-package Krawfish::Meta::Segment::Sort::Substring;
+package Krawfish::Compile::Segment::Sort::Substring;
use Krawfish::Log;
use strict;
use warnings;
diff --git a/lib/Krawfish/Meta/Segment/SortAfter.pm b/lib/Krawfish/Compile/Segment/SortAfter.pm
similarity index 96%
rename from lib/Krawfish/Meta/Segment/SortAfter.pm
rename to lib/Krawfish/Compile/Segment/SortAfter.pm
index 441a51d..d1f3642 100644
--- a/lib/Krawfish/Meta/Segment/SortAfter.pm
+++ b/lib/Krawfish/Compile/Segment/SortAfter.pm
@@ -1,12 +1,12 @@
-package Krawfish::Meta::Segment::SortAfter;
-use parent 'Krawfish::Meta::Segment::Sort';
+package Krawfish::Compile::Segment::SortAfter;
+use parent 'Krawfish::Compile::Segment::Sort';
use Data::Dumper;
use Krawfish::Log;
use strict;
use warnings;
# This sorting query is similar to
-# Krawfish::Meta::Segment::Sort,
+# Krawfish::Compile::Segment::Sort,
# But it already expects sorted, bundled postings,
# does not support $max_rank_ref
# (because all matches are already retrieved),
@@ -17,7 +17,7 @@
use constant {
- DEBUG => 1,
+ DEBUG => 0,
RANK => 0,
SAME => 1,
VALUE => 2,
diff --git a/lib/Krawfish/Controller/Corpus.pm b/lib/Krawfish/Controller/Corpus.pm
index 3ff7978..961ce3e 100644
--- a/lib/Krawfish/Controller/Corpus.pm
+++ b/lib/Krawfish/Controller/Corpus.pm
@@ -3,7 +3,7 @@
use Mojo::ByteStream 'b';
use Krawfish::Koral::Corpus::Builder;
-use Krawfish::Koral::Meta;
+use Krawfish::Koral::Compile;
use strict;
use warnings;
@@ -25,21 +25,21 @@
$koral->corpus_builder->string('corpus_id' => $corpus_id)
);
- my $meta = $koral->meta_builder;
- $meta->items_per_page($v->param('count'));
- $meta->start_index($v->param('page')); # TODO!
+ my $compile = $koral->compile_builder;
+ $compile->items_per_page($v->param('count'));
+ $compile->start_index($v->param('page')); # TODO!
# if ($v->param('sortBy')) {
- # $meta->field_sort()
+ # $compile->field_sort()
# };
# etc.
my $fields = b($v->param('fields'))->split(',')->uniq->to_array;
if ($fields->[0]) {
- $meta->fields($fields);
+ $compile->fields($fields);
};
- # Set meta
- $koral->meta($meta);
+ # Set compile
+ $koral->compile($compile);
# Get segment index
my $index = $c->index->segment;
@@ -54,7 +54,7 @@
my $self = shift;
my $koral = Krawfish::Koral->new;
- my $meta = $koral->meta_builder;
+ my $compile = $koral->compile_builder;
my $v = $c->validation;
$v->optional('fields');
@@ -75,14 +75,14 @@
# Get the field information
my $fields = b($v->param('fields'))->split(',')->uniq->to_array;
if ($fields->[0]) {
- $meta->fields($fields);
+ $compile->fields($fields);
};
# Limit to a single match
- $meta->limit(1);
+ $compile->limit(1);
- # Set meta
- $koral->meta($meta);
+ # Set compile
+ $koral->compile($compile);
# Get segment index
my $index = $c->index->segment;
diff --git a/lib/Krawfish/Koral.pm b/lib/Krawfish/Koral.pm
index f05f1aa..964e72d 100644
--- a/lib/Krawfish/Koral.pm
+++ b/lib/Krawfish/Koral.pm
@@ -7,10 +7,10 @@
use Krawfish::Koral::Document;
use Krawfish::Koral::Query::Builder;
use Krawfish::Koral::Corpus::Builder;
-use Krawfish::Koral::Meta::Builder;
-use Krawfish::Koral::Meta;
+use Krawfish::Koral::Compile::Builder;
+use Krawfish::Koral::Compile;
-use constant DEBUG => 1;
+use constant DEBUG => 0;
@@ -30,8 +30,8 @@
# $koral = Koral->new;
# my $qb = $koral->query_builder;
# my $cb = $koral->corpus_builder;
-# my $mb = $koral->meta_builder;
-# $koral->meta(
+# my $mb = $koral->compile_builder;
+# $koral->compile(
# $mb->aggregate(
# $mb->a_frequencies,
# $mb->a_fields('license'),
@@ -73,7 +73,7 @@
query => undef, # The query definition
corpus => undef, # The vc definition
matches => undef, # List of match IDs
- meta => undef, # The meta definitions
+ compile => undef, # The compile definitions
document => undef, # Document data to import
response => undef # Response object
}, $class;
@@ -126,20 +126,20 @@
};
-# Meta part of the Koral object
-sub meta {
+# Compile part of the Koral object
+sub compile {
my $self = shift;
if ($_[0]) {
- $self->{meta} = Krawfish::Koral::Meta->new(@_);
+ $self->{compile} = Krawfish::Koral::Compile->new(@_);
return $self;
};
- return $self->{meta};
+ return $self->{compile};
};
-# Get the meta builder
-sub meta_builder {
- Krawfish::Koral::Meta::Builder->new;
+# Get the compile builder
+sub compile_builder {
+ Krawfish::Koral::Compile::Builder->new;
};
@@ -191,7 +191,7 @@
else {
# TODO:
- # This may have influence on the possible meta object!
+ # This may have influence on the possible compile object!
$query = $self->corpus;
};
@@ -226,17 +226,17 @@
};
# This is just for testing
- return $query_final unless $self->meta;
+ return $query_final unless $self->compile;
- # Normalize the meta
- my $meta;
- unless ($meta = $self->meta->normalize) {
- $self->copy_info_from($self->meta);
+ # Normalize the compile
+ my $compile;
+ unless ($compile = $self->compile->normalize) {
+ $self->copy_info_from($self->compile);
return;
};
- # Serialize from meta
- return $self->meta->to_nodes($query_final);
+ # Serialize from compile
+ return $self->compile->to_nodes($query_final);
};
@@ -307,23 +307,23 @@
};
# This is just for testing
- return $query_final unless $self->meta;
+ return $query_final unless $self->compile;
if ($corpus_only) {
# TODO:
# There is only a corpus query involved,
- # this may make some meta queries neglectable!
+ # this may make some compile queries neglectable!
};
- # Normalize the meta
- my $meta;
- unless ($meta = $self->meta->normalize) {
- $self->copy_info_from($self->meta);
+ # Normalize the compile
+ my $compile;
+ unless ($compile = $self->compile->normalize) {
+ $self->copy_info_from($self->compile);
return;
};
- # Serialize from meta
- return $self->meta->wrap($query_final);
+ # Serialize from compile
+ return $self->compile->wrap($query_final);
};
@@ -417,8 +417,8 @@
my @list = ();
- if ($self->meta) {
- push @list, 'meta=[' . $self->meta->to_string . ']';
+ if ($self->compile) {
+ push @list, 'compile=[' . $self->compile->to_string . ']';
};
if ($self->corpus) {
push @list, 'corpus=[' . $self->corpus->to_string . ']';
diff --git a/lib/Krawfish/Koral/Meta.pm b/lib/Krawfish/Koral/Compile.pm
similarity index 73%
rename from lib/Krawfish/Koral/Meta.pm
rename to lib/Krawfish/Koral/Compile.pm
index d669348..22abedf 100644
--- a/lib/Krawfish/Koral/Meta.pm
+++ b/lib/Krawfish/Koral/Compile.pm
@@ -1,5 +1,5 @@
-package Krawfish::Koral::Meta;
-use Krawfish::Koral::Meta::Builder;
+package Krawfish::Koral::Compile;
+use Krawfish::Koral::Compile::Builder;
use Krawfish::Log;
use strict;
use warnings;
@@ -25,7 +25,7 @@
# This has to be thought through
-our %META_ORDER = (
+our %COMPILE_ORDER = (
limit => 1,
sort => 2,
sample => 3,
@@ -52,7 +52,7 @@
sub builder {
- return Krawfish::Koral::Meta::Builder->new;
+ return Krawfish::Koral::Compile::Builder->new;
};
@@ -67,19 +67,19 @@
};
-# Normalize meta object
+# Normalize compile object
sub normalize {
my $self = shift;
- my @meta = $self->operations;
+ my @compile = $self->operations;
my $mb = $self->builder;
# Check, if the query is a group query,
- # which invalidates some meta operations
+ # which invalidates some compile operations
my $group_query = 0;
my $top_k = 0;
- foreach (@meta) {
+ foreach (@compile) {
if ($_->type eq 'group') {
$group_query = 1;
}
@@ -90,11 +90,11 @@
# Add unique sorting per default - unless it's a group query
#unless ($group_query) {
- # push @meta,
+ # push @compile,
# $mb->sort_by($mb->s_field(UNIQUE_FIELD));
#
# if (DEBUG) {
- # print_log('kq_meta', 'Added unique field ' . UNIQUE_FIELD . ' to order');
+ # print_log('kq_compile', 'Added unique field ' . UNIQUE_FIELD . ' to order');
# };
#};
@@ -102,40 +102,40 @@
# 1. Introduce required information
# e.g. sort(field) => fields(field)
my $sort_filtering = 1;
- for (my $i = 0; $i < scalar @meta; $i++) {
+ for (my $i = 0; $i < scalar @compile; $i++) {
# For all sort fields, it may be beneficial to
# retrieve the fields as well - as they need
# to be retrieved nonetheless for search criteria
- #if ($meta[$i]->type eq 'sort') {
+ #if ($compile[$i]->type eq 'sort') {
#
# my $mb = $self->builder;
- # push @meta,
- # $mb->enrich($mb->e_fields($meta[$i]->fields));
+ # push @compile,
+ # $mb->enrich($mb->e_fields($compile[$i]->fields));
#
# if (DEBUG) {
- # print_log('kq_meta', 'Added sorting ' .
- # join(',', map {$_->to_string } $meta[$i]->fields) .
+ # print_log('kq_compile', 'Added sorting ' .
+ # join(',', map {$_->to_string } $compile[$i]->fields) .
# ' to fields');
# };
#}
# There is at least one aggregation field
#els
- if ($meta[$i]->type eq 'aggregate') {
+ if ($compile[$i]->type eq 'aggregate') {
$sort_filtering = 0;
}
# There is at least one group option
- elsif ($meta[$i]->type eq 'group') {
+ elsif ($compile[$i]->type eq 'group') {
$sort_filtering = 0;
};
};
# Sort objects based on a defined order
- @meta = sort {
- $META_ORDER{$a->type} <=> $META_ORDER{$b->type}
- } @meta;
+ @compile = sort {
+ $COMPILE_ORDER{$a->type} <=> $COMPILE_ORDER{$b->type}
+ } @compile;
# 2. Find identical types and merge
@@ -146,25 +146,25 @@
#
# 3. Remove duplicates
# aggr_freq + aggr_freq => - aggr_freq
- for (my $i = 1; $i < @meta; $i++) {
+ for (my $i = 1; $i < @compile; $i++) {
# Consecutive types are identical, join
- if ($meta[$i]->type eq $meta[$i-1]->type) {
+ if ($compile[$i]->type eq $compile[$i-1]->type) {
# Join fields or aggregations
- if ($meta[$i]->type eq 'enrich' ||
- $meta[$i]->type eq 'aggregate' ||
- $meta[$i]->type eq 'sort'
+ if ($compile[$i]->type eq 'enrich' ||
+ $compile[$i]->type eq 'aggregate' ||
+ $compile[$i]->type eq 'sort'
) {
# The first operations have higher precedence
- $meta[$i-1]->operations(
- $meta[$i-1]->operations,
- $meta[$i]->operations
+ $compile[$i-1]->operations(
+ $compile[$i-1]->operations,
+ $compile[$i]->operations
);
# Remove merged object
- splice(@meta, $i, 1);
+ splice(@compile, $i, 1);
$i--;
}
@@ -175,7 +175,7 @@
# Unknown operation
else {
- warn 'Unable to deal with unknown meta operation' . $meta[$i]->type;
+ warn 'Unable to deal with unknown compile operation' . $compile[$i]->type;
};
# Don't normalize nonmerged data
@@ -184,18 +184,18 @@
# Normalize when no longer consecutive operations
# can be expected
- $meta[$i-1] = $meta[$i-1]->normalize;
+ $compile[$i-1] = $compile[$i-1]->normalize;
};
# Normalize last operation
- $meta[-1] = $meta[-1]->normalize;
+ $compile[-1] = $compile[-1]->normalize;
# 4. Optimize
# No aggregation or group queries =>
# add a sort filter to sort
# If a limit is given, add top_k to sort
if ($sort_filtering && $top_k) {
- foreach (@meta) {
+ foreach (@compile) {
if ($_->type eq 'sort') {
# Activate sort_filter option
@@ -215,7 +215,7 @@
};
# Set operations
- $self->operations(@meta);
+ $self->operations(@compile);
return $self;
};
diff --git a/lib/Krawfish/Koral/Meta/Aggregate.pm b/lib/Krawfish/Koral/Compile/Aggregate.pm
similarity index 90%
rename from lib/Krawfish/Koral/Meta/Aggregate.pm
rename to lib/Krawfish/Koral/Compile/Aggregate.pm
index 102af9a..39930c2 100644
--- a/lib/Krawfish/Koral/Meta/Aggregate.pm
+++ b/lib/Krawfish/Koral/Compile/Aggregate.pm
@@ -1,6 +1,6 @@
-package Krawfish::Koral::Meta::Aggregate;
-use Krawfish::Koral::Meta::Node::Aggregate;
-use Krawfish::Meta::Node::Aggregate;
+package Krawfish::Koral::Compile::Aggregate;
+use Krawfish::Koral::Compile::Node::Aggregate;
+use Krawfish::Compile::Node::Aggregate;
use Krawfish::Log;
use List::MoreUtils qw/uniq/;
use strict;
@@ -49,7 +49,7 @@
};
# Join aggregates
- return Krawfish::Koral::Meta::Node::Aggregate->new(
+ return Krawfish::Koral::Compile::Node::Aggregate->new(
$query,
[$self->operations]
);
diff --git a/lib/Krawfish/Koral/Meta/Aggregate/Fields.pm b/lib/Krawfish/Koral/Compile/Aggregate/Fields.pm
similarity index 86%
rename from lib/Krawfish/Koral/Meta/Aggregate/Fields.pm
rename to lib/Krawfish/Koral/Compile/Aggregate/Fields.pm
index 27ce0fd..44c6081 100644
--- a/lib/Krawfish/Koral/Meta/Aggregate/Fields.pm
+++ b/lib/Krawfish/Koral/Compile/Aggregate/Fields.pm
@@ -1,5 +1,5 @@
-package Krawfish::Koral::Meta::Aggregate::Fields;
-use Krawfish::Meta::Segment::Aggregate::Fields;
+package Krawfish::Koral::Compile::Aggregate::Fields;
+use Krawfish::Compile::Segment::Aggregate::Fields;
use strict;
use warnings;
@@ -72,7 +72,7 @@
sub optimize {
my ($self, $segment) = @_;
- return Krawfish::Meta::Segment::Aggregate::Fields->new(
+ return Krawfish::Compile::Segment::Aggregate::Fields->new(
$segment->fields,
[$self->operations]
);
diff --git a/lib/Krawfish/Koral/Meta/Aggregate/Frequencies.pm b/lib/Krawfish/Koral/Compile/Aggregate/Frequencies.pm
similarity index 63%
rename from lib/Krawfish/Koral/Meta/Aggregate/Frequencies.pm
rename to lib/Krawfish/Koral/Compile/Aggregate/Frequencies.pm
index 4b1aad1..75ef3b4 100644
--- a/lib/Krawfish/Koral/Meta/Aggregate/Frequencies.pm
+++ b/lib/Krawfish/Koral/Compile/Aggregate/Frequencies.pm
@@ -1,5 +1,5 @@
-package Krawfish::Koral::Meta::Aggregate::Frequencies;
-use Krawfish::Meta::Segment::Aggregate::Frequencies;
+package Krawfish::Koral::Compile::Aggregate::Frequencies;
+use Krawfish::Compile::Segment::Aggregate::Frequencies;
use strict;
use warnings;
@@ -35,7 +35,7 @@
sub optimize {
my ($self, $segment) = @_;
- return Krawfish::Meta::Segment::Aggregate::Frequencies->new;
+ return Krawfish::Compile::Segment::Aggregate::Frequencies->new;
};
diff --git a/lib/Krawfish/Koral/Meta/Aggregate/Length.pm b/lib/Krawfish/Koral/Compile/Aggregate/Length.pm
similarity index 65%
rename from lib/Krawfish/Koral/Meta/Aggregate/Length.pm
rename to lib/Krawfish/Koral/Compile/Aggregate/Length.pm
index 931d421..b056bdb 100644
--- a/lib/Krawfish/Koral/Meta/Aggregate/Length.pm
+++ b/lib/Krawfish/Koral/Compile/Aggregate/Length.pm
@@ -1,5 +1,5 @@
-package Krawfish::Koral::Meta::Aggregate::Length;
-use Krawfish::Meta::Segment::Aggregate::Length;
+package Krawfish::Koral::Compile::Aggregate::Length;
+use Krawfish::Compile::Segment::Aggregate::Length;
use strict;
use warnings;
@@ -33,7 +33,7 @@
sub optimize {
my ($self, $segment) = @_;
- return Krawfish::Meta::Segment::Aggregate::Length->new;
+ return Krawfish::Compile::Segment::Aggregate::Length->new;
};
diff --git a/lib/Krawfish/Koral/Meta/Aggregate/TermFreq.pm b/lib/Krawfish/Koral/Compile/Aggregate/TermFreq.pm
similarity index 86%
rename from lib/Krawfish/Koral/Meta/Aggregate/TermFreq.pm
rename to lib/Krawfish/Koral/Compile/Aggregate/TermFreq.pm
index da33c06..c051f3a 100644
--- a/lib/Krawfish/Koral/Meta/Aggregate/TermFreq.pm
+++ b/lib/Krawfish/Koral/Compile/Aggregate/TermFreq.pm
@@ -1,11 +1,11 @@
-package Krawfish::Koral::Meta::Aggregate::TermFreq;
+package Krawfish::Koral::Compile::Aggregate::TermFreq;
use strict;
use warnings;
# TODO:
# This is rather a group query than an aggregation query.
-# This calls Krawfish::Meta::Segment::Aggregate::TermFreq.
+# This calls Krawfish::Compile::Segment::Aggregate::TermFreq.
# It is used (among other things) for Co-Occurrence Search.
#
# It will return, for a list of terms, the frequency of the terms
diff --git a/lib/Krawfish/Koral/Meta/Aggregate/Values.pm b/lib/Krawfish/Koral/Compile/Aggregate/Values.pm
similarity index 87%
rename from lib/Krawfish/Koral/Meta/Aggregate/Values.pm
rename to lib/Krawfish/Koral/Compile/Aggregate/Values.pm
index e91e91d..f4fbfb2 100644
--- a/lib/Krawfish/Koral/Meta/Aggregate/Values.pm
+++ b/lib/Krawfish/Koral/Compile/Aggregate/Values.pm
@@ -1,5 +1,5 @@
-package Krawfish::Koral::Meta::Aggregate::Values;
-use Krawfish::Meta::Segment::Aggregate::Values;
+package Krawfish::Koral::Compile::Aggregate::Values;
+use Krawfish::Compile::Segment::Aggregate::Values;
use strict;
use warnings;
@@ -74,7 +74,7 @@
sub optimize {
my ($self, $segment) = @_;
- return Krawfish::Meta::Segment::Aggregate::Values->new(
+ return Krawfish::Compile::Segment::Aggregate::Values->new(
$segment->fields,
[$self->operations]
);
diff --git a/lib/Krawfish/Koral/Compile/Builder.pm b/lib/Krawfish/Koral/Compile/Builder.pm
new file mode 100644
index 0000000..00ea651
--- /dev/null
+++ b/lib/Krawfish/Koral/Compile/Builder.pm
@@ -0,0 +1,208 @@
+package Krawfish::Koral::Compile::Builder;
+use strict;
+use warnings;
+
+use Krawfish::Koral::Compile::Aggregate;
+
+# TODO:
+# These should all be moved to ::Compile::Cluster::*
+use Krawfish::Koral::Compile::Limit;
+use Krawfish::Koral::Compile::Sort;
+use Krawfish::Koral::Compile::Sort::Field;
+use Krawfish::Koral::Compile::Sort::Sample;
+use Krawfish::Koral::Compile::Aggregate::Frequencies;
+use Krawfish::Koral::Compile::Aggregate::Fields;
+use Krawfish::Koral::Compile::Aggregate::Length;
+use Krawfish::Koral::Compile::Aggregate::Values;
+use Krawfish::Koral::Compile::Group;
+use Krawfish::Koral::Compile::Group::Fields;
+use Krawfish::Koral::Compile::Group::ClassFrequencies;
+
+use Krawfish::Koral::Compile::Enrich;
+use Krawfish::Koral::Compile::Enrich::Terms;
+use Krawfish::Koral::Compile::Enrich::Fields;
+use Krawfish::Koral::Compile::Enrich::Snippet;
+use Krawfish::Koral::Compile::Enrich::Snippet::Context::Span;
+
+use Krawfish::Koral::Compile::Type::Key;
+use Scalar::Util qw/blessed/;
+
+sub new {
+ my $class = shift;
+ bless [], $class;
+};
+
+# $koral->compile(
+# $mb->aggregate(
+# $mb->a_frequencies,
+# $mb->a_fields('license'),
+# $mb->a_fields('corpus'),
+# $mb->a_length
+# ),
+# $mb->start_index(0),
+# $mn->items_per_page(20)
+# $mb->sort_by(
+# $mb->sort_field('author', 1)
+# ),
+# $mb->fields('author')
+# $mb->snippet('')
+
+sub aggregate {
+ my $self = shift;
+ return Krawfish::Koral::Compile::Aggregate->new(@_);
+};
+
+# Some aggregation types
+# Aggregate frequencies
+sub a_frequencies {
+ return Krawfish::Koral::Compile::Aggregate::Frequencies->new;
+};
+
+
+# Aggregate fields
+sub a_fields {
+ shift;
+ return Krawfish::Koral::Compile::Aggregate::Fields->new(
+ map {
+ blessed $_ ? $_ : Krawfish::Koral::Compile::Type::Key->new($_)
+ } @_
+ );
+};
+
+
+# Aggregate lengths of matches
+sub a_length {
+ return Krawfish::Koral::Compile::Aggregate::Length->new;
+};
+
+
+# Aggregate numerical values
+sub a_values {
+ shift;
+ return Krawfish::Koral::Compile::Aggregate::Values->new(
+ map {
+ blessed $_ ? $_ : Krawfish::Koral::Compile::Type::Key->new($_)
+ } @_
+ );
+};
+
+
+# Enrich matched with additional information
+sub enrich {
+ shift;
+ return Krawfish::Koral::Compile::Enrich->new(@_);
+};
+
+
+# Enrich with fields
+sub e_fields {
+ shift;
+ return Krawfish::Koral::Compile::Enrich::Fields->new(
+ map {
+ blessed $_ ? $_ : Krawfish::Koral::Compile::Type::Key->new($_)
+ } @_
+ );
+};
+
+
+# Enrich with snippets
+sub e_snippet {
+ shift;
+ # Accepts: left_context => $mb->e_char_context(5)
+ return Krawfish::Koral::Compile::Enrich::Snippet->new(@_);
+};
+
+
+# Set char context
+sub e_char_context {
+ shift;
+ my $count = shift;
+ ...
+ # return Krawfish::Koral::Compile::Enrich::Snippet::Context::Char->new($count);
+};
+
+
+# Set token context
+sub e_token_context {
+ shift;
+ my ($count, $foundry) = @_;
+ ...
+ # return Krawfish::Koral::Compile::Enrich::Snippet::Context::Token->new($count, $foundry);
+};
+
+
+sub e_span_context {
+ shift;
+ my ($term, $count) = @_;
+ return Krawfish::Koral::Compile::Enrich::Snippet::Context::Span->new($term, $count);
+};
+
+# Enrich with Term lists per class
+sub e_terms {
+ shift;
+ return Krawfish::Koral::Compile::Enrich::Terms->new(@_);
+};
+
+
+# Grouping object
+sub group_by {
+ shift;
+ return Krawfish::Koral::Compile::Group->new(@_);
+};
+
+
+# Group by fields
+sub g_fields {
+ shift;
+ return Krawfish::Koral::Compile::Group::Fields->new(
+ map {
+ blessed $_ ? $_ : Krawfish::Koral::Compile::Type::Key->new($_)
+ } @_
+ );
+};
+
+
+# Group by class frequencies
+sub g_class_freq {
+ shift;
+ return Krawfish::Koral::Compile::Group::ClassFrequencies->new(@_);
+};
+
+
+# Sort results by different criteria
+sub sort_by {
+ shift;
+ return Krawfish::Koral::Compile::Sort->new(@_);
+};
+
+
+# Some sorting criteria
+sub s_field {
+ shift;
+ return Krawfish::Koral::Compile::Sort::Field->new(
+ blessed $_[0] ? $_[0] : Krawfish::Koral::Compile::Type::Key->new($_[0]),
+ $_[1]
+ );
+};
+
+
+# Get a sample of size X
+sub s_sample {
+ shift;
+ return Krawfish::Koral::Compile::Sort::Sample->new(shift);
+};
+
+# TODO:
+# s_class (sort by the surface form of a class, necessary for concordances)
+
+
+sub limit {
+ shift;
+ # start_index, items_per_page
+ return Krawfish::Koral::Compile::Limit->new(@_);
+};
+
+
+1;
+
+__END__
diff --git a/lib/Krawfish/Koral/Meta/Enrich.pm b/lib/Krawfish/Koral/Compile/Enrich.pm
similarity index 97%
rename from lib/Krawfish/Koral/Meta/Enrich.pm
rename to lib/Krawfish/Koral/Compile/Enrich.pm
index e5354cb..3f8f75c 100644
--- a/lib/Krawfish/Koral/Meta/Enrich.pm
+++ b/lib/Krawfish/Koral/Compile/Enrich.pm
@@ -1,4 +1,4 @@
-package Krawfish::Koral::Meta::Enrich;
+package Krawfish::Koral::Compile::Enrich;
use Krawfish::Log;
use strict;
use warnings;
diff --git a/lib/Krawfish/Koral/Meta/Enrich/Fields.pm b/lib/Krawfish/Koral/Compile/Enrich/Fields.pm
similarity index 82%
rename from lib/Krawfish/Koral/Meta/Enrich/Fields.pm
rename to lib/Krawfish/Koral/Compile/Enrich/Fields.pm
index a2db701..09f6daf 100644
--- a/lib/Krawfish/Koral/Meta/Enrich/Fields.pm
+++ b/lib/Krawfish/Koral/Compile/Enrich/Fields.pm
@@ -1,5 +1,5 @@
-package Krawfish::Koral::Meta::Enrich::Fields;
-use Krawfish::Koral::Meta::Node::Enrich::Fields;
+package Krawfish::Koral::Compile::Enrich::Fields;
+use Krawfish::Koral::Compile::Node::Enrich::Fields;
use strict;
use warnings;
@@ -46,7 +46,7 @@
# Create a single query tree
sub wrap {
my ($self, $query) = @_;
- return Krawfish::Koral::Meta::Node::Enrich::Fields->new(
+ return Krawfish::Koral::Compile::Node::Enrich::Fields->new(
$query,
[$self->operations]
);
diff --git a/lib/Krawfish/Koral/Meta/Enrich/Snippet.pm b/lib/Krawfish/Koral/Compile/Enrich/Snippet.pm
similarity index 83%
rename from lib/Krawfish/Koral/Meta/Enrich/Snippet.pm
rename to lib/Krawfish/Koral/Compile/Enrich/Snippet.pm
index aa5cec6..497f76f 100644
--- a/lib/Krawfish/Koral/Meta/Enrich/Snippet.pm
+++ b/lib/Krawfish/Koral/Compile/Enrich/Snippet.pm
@@ -1,6 +1,6 @@
-package Krawfish::Koral::Meta::Enrich::Snippet;
-use Krawfish::Koral::Meta::Enrich::Snippet::Hit;
-use Krawfish::Koral::Meta::Node::Enrich::Snippet;
+package Krawfish::Koral::Compile::Enrich::Snippet;
+use Krawfish::Koral::Compile::Enrich::Snippet::Hit;
+use Krawfish::Koral::Compile::Node::Enrich::Snippet;
use strict;
use warnings;
@@ -55,7 +55,7 @@
};
# Create empty hit object
- $self->{hit} = Krawfish::Koral::Meta::Enrich::Snippet::Hit->new;
+ $self->{hit} = Krawfish::Koral::Compile::Enrich::Snippet::Hit->new;
return $self->{hit};
};
@@ -87,7 +87,7 @@
# Wrap the query
sub wrap {
my ($self, $query) = @_;
- return Krawfish::Koral::Meta::Node::Enrich::Snippet->new(
+ return Krawfish::Koral::Compile::Node::Enrich::Snippet->new(
query => $query,
left => $self->left_context,
right => $self->right_context,
diff --git a/lib/Krawfish/Koral/Meta/Enrich/Snippet/Context/Decorator.pm b/lib/Krawfish/Koral/Compile/Enrich/Snippet/Context/Decorator.pm
similarity index 100%
rename from lib/Krawfish/Koral/Meta/Enrich/Snippet/Context/Decorator.pm
rename to lib/Krawfish/Koral/Compile/Enrich/Snippet/Context/Decorator.pm
diff --git a/lib/Krawfish/Koral/Meta/Enrich/Snippet/Context/Span.pm b/lib/Krawfish/Koral/Compile/Enrich/Snippet/Context/Span.pm
similarity index 91%
rename from lib/Krawfish/Koral/Meta/Enrich/Snippet/Context/Span.pm
rename to lib/Krawfish/Koral/Compile/Enrich/Snippet/Context/Span.pm
index e862b6d..45486d0 100644
--- a/lib/Krawfish/Koral/Meta/Enrich/Snippet/Context/Span.pm
+++ b/lib/Krawfish/Koral/Compile/Enrich/Snippet/Context/Span.pm
@@ -1,5 +1,5 @@
-package Krawfish::Koral::Meta::Enrich::Snippet::Context::Span;
-use Krawfish::Meta::Segment::Enrich::Snippet::Context::Span;
+package Krawfish::Koral::Compile::Enrich::Snippet::Context::Span;
+use Krawfish::Compile::Segment::Enrich::Snippet::Context::Span;
use Krawfish::Util::Constants qw/:PREFIX/;
use Krawfish::Koral::Query::Term;
use Krawfish::Log;
@@ -115,7 +115,7 @@
# Adapt element to segment
sub optimize {
my ($self, $segment) = @_;
- return Krawfish::Meta::Segment::Enrich::Snippet::Context::Span->new(
+ return Krawfish::Compile::Segment::Enrich::Snippet::Context::Span->new(
foundry_id => $self->foundry_id,
layer_id => $self->layer_id,
anno_id => $self->anno_id,
diff --git a/lib/Krawfish/Koral/Meta/Enrich/Snippet/Hit.pm b/lib/Krawfish/Koral/Compile/Enrich/Snippet/Hit.pm
similarity index 62%
rename from lib/Krawfish/Koral/Meta/Enrich/Snippet/Hit.pm
rename to lib/Krawfish/Koral/Compile/Enrich/Snippet/Hit.pm
index 63ef54b..6052411 100644
--- a/lib/Krawfish/Koral/Meta/Enrich/Snippet/Hit.pm
+++ b/lib/Krawfish/Koral/Compile/Enrich/Snippet/Hit.pm
@@ -1,5 +1,5 @@
-package Krawfish::Koral::Meta::Enrich::Snippet::Hit;
-use Krawfish::Meta::Segment::Enrich::Snippet::Hit;
+package Krawfish::Koral::Compile::Enrich::Snippet::Hit;
+use Krawfish::Compile::Segment::Enrich::Snippet::Hit;
use strict;
use warnings;
@@ -17,7 +17,7 @@
sub optimize {
my $self = shift;
- Krawfish::Meta::Segment::Enrich::Snippet::Hit->new(
+ Krawfish::Compile::Segment::Enrich::Snippet::Hit->new(
%$self
);
};
diff --git a/lib/Krawfish/Koral/Meta/Enrich/Terms.pm b/lib/Krawfish/Koral/Compile/Enrich/Terms.pm
similarity index 79%
rename from lib/Krawfish/Koral/Meta/Enrich/Terms.pm
rename to lib/Krawfish/Koral/Compile/Enrich/Terms.pm
index 96d432a..6250748 100644
--- a/lib/Krawfish/Koral/Meta/Enrich/Terms.pm
+++ b/lib/Krawfish/Koral/Compile/Enrich/Terms.pm
@@ -1,5 +1,5 @@
-package Krawfish::Koral::Meta::Enrich::Terms;
-use Krawfish::Koral::Meta::Node::Enrich::Terms;
+package Krawfish::Koral::Compile::Enrich::Terms;
+use Krawfish::Koral::Compile::Node::Enrich::Terms;
use List::MoreUtils qw/uniq/;
use strict;
use warnings;
@@ -39,7 +39,7 @@
# Create single query tree
sub wrap {
my ($self, $query) = @_;
- return Krawfish::Koral::Meta::Node::Enrich::Terms->new(
+ return Krawfish::Koral::Compile::Node::Enrich::Terms->new(
$query,
[$self->operations]
);
diff --git a/lib/Krawfish/Koral/Meta/Group.pm b/lib/Krawfish/Koral/Compile/Group.pm
similarity index 91%
rename from lib/Krawfish/Koral/Meta/Group.pm
rename to lib/Krawfish/Koral/Compile/Group.pm
index c04d4bf..5d5250e 100644
--- a/lib/Krawfish/Koral/Meta/Group.pm
+++ b/lib/Krawfish/Koral/Compile/Group.pm
@@ -1,4 +1,4 @@
-package Krawfish::Koral::Meta::Group;
+package Krawfish::Koral::Compile::Group;
use strict;
use warnings;
diff --git a/lib/Krawfish/Koral/Meta/Group/ClassFrequencies.pm b/lib/Krawfish/Koral/Compile/Group/ClassFrequencies.pm
similarity index 76%
rename from lib/Krawfish/Koral/Meta/Group/ClassFrequencies.pm
rename to lib/Krawfish/Koral/Compile/Group/ClassFrequencies.pm
index 4a66485..7b09dcb 100644
--- a/lib/Krawfish/Koral/Meta/Group/ClassFrequencies.pm
+++ b/lib/Krawfish/Koral/Compile/Group/ClassFrequencies.pm
@@ -1,6 +1,6 @@
-package Krawfish::Koral::Meta::Group::ClassFrequencies;
+package Krawfish::Koral::Compile::Group::ClassFrequencies;
use List::Util qw/uniq/;
-use Krawfish::Koral::Meta::Node::Group::ClassFrequencies;
+use Krawfish::Koral::Compile::Node::Group::ClassFrequencies;
use strict;
use warnings;
@@ -38,7 +38,7 @@
sub wrap {
my ($self, $query) = @_;
- return Krawfish::Koral::Meta::Node::Group::ClassFrequencies->new(
+ return Krawfish::Koral::Compile::Node::Group::ClassFrequencies->new(
$query,
[$self->operations]
)
diff --git a/lib/Krawfish/Koral/Meta/Group/Fields.pm b/lib/Krawfish/Koral/Compile/Group/Fields.pm
similarity index 87%
rename from lib/Krawfish/Koral/Meta/Group/Fields.pm
rename to lib/Krawfish/Koral/Compile/Group/Fields.pm
index 1895518..8cfd9cc 100644
--- a/lib/Krawfish/Koral/Meta/Group/Fields.pm
+++ b/lib/Krawfish/Koral/Compile/Group/Fields.pm
@@ -1,5 +1,5 @@
-package Krawfish::Koral::Meta::Group::Fields;
-use Krawfish::Koral::Meta::Node::Group::Fields;
+package Krawfish::Koral::Compile::Group::Fields;
+use Krawfish::Koral::Compile::Node::Group::Fields;
use strict;
use warnings;
@@ -47,7 +47,7 @@
sub wrap {
my ($self, $query) = @_;
- return Krawfish::Koral::Meta::Node::Group::Fields->new(
+ return Krawfish::Koral::Compile::Node::Group::Fields->new(
$query,
[$self->operations]
)
diff --git a/lib/Krawfish/Koral/Meta/Limit.pm b/lib/Krawfish/Koral/Compile/Limit.pm
similarity index 87%
rename from lib/Krawfish/Koral/Meta/Limit.pm
rename to lib/Krawfish/Koral/Compile/Limit.pm
index 7b3a922..51bcf11 100644
--- a/lib/Krawfish/Koral/Meta/Limit.pm
+++ b/lib/Krawfish/Koral/Compile/Limit.pm
@@ -1,5 +1,5 @@
-package Krawfish::Koral::Meta::Limit;
-use Krawfish::Koral::Meta::Node::Limit;
+package Krawfish::Koral::Compile::Limit;
+use Krawfish::Koral::Compile::Node::Limit;
use strict;
use warnings;
@@ -43,7 +43,7 @@
return $query;
};
- return Krawfish::Koral::Meta::Node::Limit->new(
+ return Krawfish::Koral::Compile::Node::Limit->new(
$query,
$self->start_index,
$self->items_per_page
diff --git a/lib/Krawfish/Koral/Meta/Node/Aggregate.pm b/lib/Krawfish/Koral/Compile/Node/Aggregate.pm
similarity index 89%
rename from lib/Krawfish/Koral/Meta/Node/Aggregate.pm
rename to lib/Krawfish/Koral/Compile/Node/Aggregate.pm
index e9e67ae..5b72d81 100644
--- a/lib/Krawfish/Koral/Meta/Node/Aggregate.pm
+++ b/lib/Krawfish/Koral/Compile/Node/Aggregate.pm
@@ -1,5 +1,5 @@
-package Krawfish::Koral::Meta::Node::Aggregate;
-use Krawfish::Meta::Segment::Aggregate;
+package Krawfish::Koral::Compile::Node::Aggregate;
+use Krawfish::Compile::Segment::Aggregate;
use Krawfish::Query::Nowhere;
use strict;
use warnings;
@@ -59,7 +59,7 @@
$aggr->[$i] = $aggr->[$i]->optimize($segment);
};
- return Krawfish::Meta::Segment::Aggregate->new(
+ return Krawfish::Compile::Segment::Aggregate->new(
$query,
$aggr
);
diff --git a/lib/Krawfish/Koral/Meta/Node/Enrich/Fields.pm b/lib/Krawfish/Koral/Compile/Node/Enrich/Fields.pm
similarity index 89%
rename from lib/Krawfish/Koral/Meta/Node/Enrich/Fields.pm
rename to lib/Krawfish/Koral/Compile/Node/Enrich/Fields.pm
index 33cd307..413f273 100644
--- a/lib/Krawfish/Koral/Meta/Node/Enrich/Fields.pm
+++ b/lib/Krawfish/Koral/Compile/Node/Enrich/Fields.pm
@@ -1,5 +1,5 @@
-package Krawfish::Koral::Meta::Node::Enrich::Fields;
-use Krawfish::Meta::Segment::Enrich::Fields;
+package Krawfish::Koral::Compile::Node::Enrich::Fields;
+use Krawfish::Compile::Segment::Enrich::Fields;
use Krawfish::Util::String qw/squote/;
use Krawfish::Query::Nowhere;
use strict;
@@ -66,7 +66,7 @@
return Krawfish::Query::Nowhere->new;
};
- return Krawfish::Meta::Segment::Enrich::Fields->new(
+ return Krawfish::Compile::Segment::Enrich::Fields->new(
$segment->fields,
$query,
$self->term_ids
diff --git a/lib/Krawfish/Koral/Meta/Node/Enrich/Snippet.pm b/lib/Krawfish/Koral/Compile/Node/Enrich/Snippet.pm
similarity index 91%
rename from lib/Krawfish/Koral/Meta/Node/Enrich/Snippet.pm
rename to lib/Krawfish/Koral/Compile/Node/Enrich/Snippet.pm
index 60d24a7..2da9f81 100644
--- a/lib/Krawfish/Koral/Meta/Node/Enrich/Snippet.pm
+++ b/lib/Krawfish/Koral/Compile/Node/Enrich/Snippet.pm
@@ -1,5 +1,5 @@
-package Krawfish::Koral::Meta::Node::Enrich::Snippet;
-use Krawfish::Meta::Segment::Enrich::Snippet;
+package Krawfish::Koral::Compile::Node::Enrich::Snippet;
+use Krawfish::Compile::Segment::Enrich::Snippet;
use Krawfish::Util::String qw/squote/;
use Krawfish::Query::Nowhere;
use strict;
@@ -83,7 +83,7 @@
$self->{hit} = $self->{hit}->optimize($segment);
# Return snippet object
- return Krawfish::Meta::Segment::Enrich::Snippet->new(
+ return Krawfish::Compile::Segment::Enrich::Snippet->new(
query => $query,
fwd_obj => $segment->forward,
hit => $self->{hit},
diff --git a/lib/Krawfish/Koral/Meta/Node/Enrich/Terms.pm b/lib/Krawfish/Koral/Compile/Node/Enrich/Terms.pm
similarity index 82%
rename from lib/Krawfish/Koral/Meta/Node/Enrich/Terms.pm
rename to lib/Krawfish/Koral/Compile/Node/Enrich/Terms.pm
index 72696ef..618c67f 100644
--- a/lib/Krawfish/Koral/Meta/Node/Enrich/Terms.pm
+++ b/lib/Krawfish/Koral/Compile/Node/Enrich/Terms.pm
@@ -1,5 +1,5 @@
-package Krawfish::Koral::Meta::Node::Enrich::Terms;
-use Krawfish::Meta::Segment::Enrich::Terms;
+package Krawfish::Koral::Compile::Node::Enrich::Terms;
+use Krawfish::Compile::Segment::Enrich::Terms;
use Krawfish::Query::Nowhere;
use strict;
use warnings;
@@ -40,7 +40,7 @@
return Krawfish::Query::Nowhere->new;
};
- return Krawfish::Meta::Segment::Enrich::Terms->new(
+ return Krawfish::Compile::Segment::Enrich::Terms->new(
$segment->forward,
$query,
$self->{nrs}
diff --git a/lib/Krawfish/Koral/Meta/Node/Group.pm b/lib/Krawfish/Koral/Compile/Node/Group.pm
similarity index 93%
rename from lib/Krawfish/Koral/Meta/Node/Group.pm
rename to lib/Krawfish/Koral/Compile/Node/Group.pm
index 60ca7a8..46f4188 100644
--- a/lib/Krawfish/Koral/Meta/Node/Group.pm
+++ b/lib/Krawfish/Koral/Compile/Node/Group.pm
@@ -1,4 +1,4 @@
-package Krawfish::Koral::Meta::Node::Group;
+package Krawfish::Koral::Compile::Node::Group;
use Krawfish::Log;
use strict;
use warnings;
diff --git a/lib/Krawfish/Koral/Meta/Node/Group/ClassFrequencies.pm b/lib/Krawfish/Koral/Compile/Node/Group/ClassFrequencies.pm
similarity index 81%
rename from lib/Krawfish/Koral/Meta/Node/Group/ClassFrequencies.pm
rename to lib/Krawfish/Koral/Compile/Node/Group/ClassFrequencies.pm
index cbe6eaf..5c71ab9 100644
--- a/lib/Krawfish/Koral/Meta/Node/Group/ClassFrequencies.pm
+++ b/lib/Krawfish/Koral/Compile/Node/Group/ClassFrequencies.pm
@@ -1,5 +1,5 @@
-package Krawfish::Koral::Meta::Node::Group::ClassFrequencies;
-use Krawfish::Meta::Segment::Group::ClassFrequencies;
+package Krawfish::Koral::Compile::Node::Group::ClassFrequencies;
+use Krawfish::Compile::Segment::Group::ClassFrequencies;
use Krawfish::Util::String qw/squote/;
use Krawfish::Query::Nowhere;
use strict;
@@ -41,7 +41,7 @@
return Krawfish::Query::Nowhere->new;
};
- return Krawfish::Meta::Segment::Group::ClassFrequencies->new(
+ return Krawfish::Compile::Segment::Group::ClassFrequencies->new(
$segment->forward,
$query,
$self->{classes}
diff --git a/lib/Krawfish/Koral/Meta/Node/Group/Fields.pm b/lib/Krawfish/Koral/Compile/Node/Group/Fields.pm
similarity index 89%
rename from lib/Krawfish/Koral/Meta/Node/Group/Fields.pm
rename to lib/Krawfish/Koral/Compile/Node/Group/Fields.pm
index 5e7d175..88a2fe4 100644
--- a/lib/Krawfish/Koral/Meta/Node/Group/Fields.pm
+++ b/lib/Krawfish/Koral/Compile/Node/Group/Fields.pm
@@ -1,5 +1,5 @@
-package Krawfish::Koral::Meta::Node::Group::Fields;
-use Krawfish::Meta::Segment::Group::Fields;
+package Krawfish::Koral::Compile::Node::Group::Fields;
+use Krawfish::Compile::Segment::Group::Fields;
use Krawfish::Util::String qw/squote/;
use Krawfish::Query::Nowhere;
use strict;
@@ -66,7 +66,7 @@
return Krawfish::Query::Nowhere->new;
};
- return Krawfish::Meta::Segment::Group::Fields->new(
+ return Krawfish::Compile::Segment::Group::Fields->new(
$segment->fields,
$query,
$self->term_ids
diff --git a/lib/Krawfish/Koral/Meta/Node/Limit.pm b/lib/Krawfish/Koral/Compile/Node/Limit.pm
similarity index 87%
rename from lib/Krawfish/Koral/Meta/Node/Limit.pm
rename to lib/Krawfish/Koral/Compile/Node/Limit.pm
index 85f20c5..3bc2dcd 100644
--- a/lib/Krawfish/Koral/Meta/Node/Limit.pm
+++ b/lib/Krawfish/Koral/Compile/Node/Limit.pm
@@ -1,9 +1,9 @@
-package Krawfish::Koral::Meta::Node::Limit;
+package Krawfish::Koral::Compile::Node::Limit;
# TODO:
# Limiting can only be done on the cluster level!
-use Krawfish::Meta::Cluster::Limit;
+use Krawfish::Compile::Cluster::Limit;
use Krawfish::Query::Nowhere;
use Krawfish::Log;
use strict;
@@ -53,7 +53,7 @@
return Krawfish::Query::Nowhere->new;
};
- return Krawfish::Meta::Limit->new(
+ return Krawfish::Compile::Limit->new(
$query,
$self->{start_index},
$self->{items_per_page}
diff --git a/lib/Krawfish/Koral/Meta/Node/Sort.pm b/lib/Krawfish/Koral/Compile/Node/Sort.pm
similarity index 88%
rename from lib/Krawfish/Koral/Meta/Node/Sort.pm
rename to lib/Krawfish/Koral/Compile/Node/Sort.pm
index b632d48..2b552c2 100644
--- a/lib/Krawfish/Koral/Meta/Node/Sort.pm
+++ b/lib/Krawfish/Koral/Compile/Node/Sort.pm
@@ -1,7 +1,7 @@
-package Krawfish::Koral::Meta::Node::Sort;
-use Krawfish::Meta::Segment::Sort;
-use Krawfish::Meta::Segment::SortAfter;
-use Krawfish::Meta::Segment::BundleDocs;
+package Krawfish::Koral::Compile::Node::Sort;
+use Krawfish::Compile::Segment::Sort;
+use Krawfish::Compile::Segment::SortAfter;
+use Krawfish::Compile::Segment::BundleDocs;
use Krawfish::Query::Nowhere;
use Krawfish::Log;
use strict;
@@ -111,16 +111,16 @@
};
# TODO:
- # Return Krawfish::Meta::Segment::Sort::Fine->new;
+ # Return Krawfish::Compile::Segment::Sort::Fine->new;
# in case it is a follow up!
# follow_up => $self->{follow_up}
# Bundle documents
if ($sort->type eq 'field' && !$self->{follow_up}) {
- $query = Krawfish::Meta::Segment::BundleDocs->new($query);
+ $query = Krawfish::Compile::Segment::BundleDocs->new($query);
# Return sort object
- return Krawfish::Meta::Segment::Sort->new(
+ return Krawfish::Compile::Segment::Sort->new(
query => $query,
segment => $segment,
sort => $sort,
@@ -129,7 +129,7 @@
);
};
- return Krawfish::Meta::Segment::SortAfter->new(
+ return Krawfish::Compile::Segment::SortAfter->new(
query => $query,
segment => $segment,
sort => $sort,
diff --git a/lib/Krawfish/Koral/Meta/Node/Sort/Sample.pm b/lib/Krawfish/Koral/Compile/Node/Sort/Sample.pm
similarity index 83%
rename from lib/Krawfish/Koral/Meta/Node/Sort/Sample.pm
rename to lib/Krawfish/Koral/Compile/Node/Sort/Sample.pm
index 2c22e5c..abedc35 100644
--- a/lib/Krawfish/Koral/Meta/Node/Sort/Sample.pm
+++ b/lib/Krawfish/Koral/Compile/Node/Sort/Sample.pm
@@ -1,5 +1,5 @@
-package Krawfish::Koral::Meta::Node::Sort::Sample;
-use Krawfish::Meta::Segment::Sort::Sample;
+package Krawfish::Koral::Compile::Node::Sort::Sample;
+use Krawfish::Compile::Segment::Sort::Sample;
use Krawfish::Query::Nowhere;
use strict;
use warnings;
@@ -46,7 +46,7 @@
return Krawfish::Query::Nowhere->new;
};
- return Krawfish::Meta::Segment::Sort::Sample->new(
+ return Krawfish::Compile::Segment::Sort::Sample->new(
$query,
$self->{top_k}
)
diff --git a/lib/Krawfish/Koral/Meta/Sort.pm b/lib/Krawfish/Koral/Compile/Sort.pm
similarity index 90%
rename from lib/Krawfish/Koral/Meta/Sort.pm
rename to lib/Krawfish/Koral/Compile/Sort.pm
index bae95f9..6746ef8 100644
--- a/lib/Krawfish/Koral/Meta/Sort.pm
+++ b/lib/Krawfish/Koral/Compile/Sort.pm
@@ -1,7 +1,7 @@
-package Krawfish::Koral::Meta::Sort;
-use Krawfish::Koral::Meta::Node::Sort;
-use Krawfish::Koral::Meta::Sort::Field;
-use Krawfish::Koral::Meta::Type::Key;
+package Krawfish::Koral::Compile::Sort;
+use Krawfish::Koral::Compile::Node::Sort;
+use Krawfish::Koral::Compile::Sort::Field;
+use Krawfish::Koral::Compile::Type::Key;
use Krawfish::Log;
use strict;
use warnings;
@@ -105,8 +105,8 @@
my $sampling = 0;
# Add unique sorting to sort array
- push @{$self->{sort}}, Krawfish::Koral::Meta::Sort::Field->new(
- Krawfish::Koral::Meta::Type::Key->new($self->{unique})
+ push @{$self->{sort}}, Krawfish::Koral::Compile::Sort::Field->new(
+ Krawfish::Koral::Compile::Type::Key->new($self->{unique})
);
# Normalize sorting
@@ -147,7 +147,7 @@
# later by checking the nesting of the queries.
my $follow_up = 0;
foreach my $op ($self->operations) {
- $query = Krawfish::Koral::Meta::Node::Sort->new(
+ $query = Krawfish::Koral::Compile::Node::Sort->new(
$query,
$op,
$self->top_k,
diff --git a/lib/Krawfish/Koral/Meta/Sort/Field.pm b/lib/Krawfish/Koral/Compile/Sort/Field.pm
similarity index 74%
rename from lib/Krawfish/Koral/Meta/Sort/Field.pm
rename to lib/Krawfish/Koral/Compile/Sort/Field.pm
index 6b3a2fa..2057791 100644
--- a/lib/Krawfish/Koral/Meta/Sort/Field.pm
+++ b/lib/Krawfish/Koral/Compile/Sort/Field.pm
@@ -1,6 +1,6 @@
-package Krawfish::Koral::Meta::Sort::Field;
-use Krawfish::Meta::Segment::Sort::Field;
-use Krawfish::Koral::Meta::Sort::No;
+package Krawfish::Koral::Compile::Sort::Field;
+use Krawfish::Compile::Segment::Sort::Field;
+use Krawfish::Koral::Compile::Sort::No;
use Krawfish::Util::String qw/squote/;
use strict;
use warnings;
@@ -8,7 +8,7 @@
sub new {
my $class = shift;
bless {
- field => shift, # Is a Koral::Meta::Type::Key / KeyID
+ field => shift, # Is a Koral::Compile::Type::Key / KeyID
desc => shift
}, $class;
};
@@ -28,7 +28,7 @@
sub optimize {
my ($self, $segment) = @_;
- return Krawfish::Meta::Segment::Sort::Field->new(
+ return Krawfish::Compile::Segment::Sort::Field->new(
$segment,
$_[0]->{field}->term_id,
$_[0]->{desc}
@@ -48,7 +48,7 @@
# Field does not exist in the dictionary
unless ($field) {
- return Krawfish::Koral::Meta::Sort::No->new(
+ return Krawfish::Koral::Compile::Sort::No->new(
$self->{field}, $self->{desc}
);
};
diff --git a/lib/Krawfish/Koral/Meta/Sort/No.pm b/lib/Krawfish/Koral/Compile/Sort/No.pm
similarity index 73%
rename from lib/Krawfish/Koral/Meta/Sort/No.pm
rename to lib/Krawfish/Koral/Compile/Sort/No.pm
index 449c796..eb6b973 100644
--- a/lib/Krawfish/Koral/Meta/Sort/No.pm
+++ b/lib/Krawfish/Koral/Compile/Sort/No.pm
@@ -1,5 +1,5 @@
-package Krawfish::Koral::Meta::Sort::No;
-use Krawfish::Meta::Segment::Sort::No;
+package Krawfish::Koral::Compile::Sort::No;
+use Krawfish::Compile::Segment::Sort::No;
use Krawfish::Util::String qw/squote/;
use strict;
use warnings;
@@ -9,7 +9,7 @@
sub new {
my $class = shift;
bless {
- field => shift, # Is a Koral::Meta::Type
+ field => shift, # Is a Koral::Compile::Type
desc => shift
}, $class;
};
@@ -27,7 +27,7 @@
};
sub optimize {
- return Krawfish::Meta::Segment::Sort::No->new(
+ return Krawfish::Compile::Segment::Sort::No->new(
$_[0]->{field}->term,
$_[0]->{desc}
);
diff --git a/lib/Krawfish/Koral/Meta/Sort/Sample.pm b/lib/Krawfish/Koral/Compile/Sort/Sample.pm
similarity index 77%
rename from lib/Krawfish/Koral/Meta/Sort/Sample.pm
rename to lib/Krawfish/Koral/Compile/Sort/Sample.pm
index e9a2932..5d68102 100644
--- a/lib/Krawfish/Koral/Meta/Sort/Sample.pm
+++ b/lib/Krawfish/Koral/Compile/Sort/Sample.pm
@@ -1,5 +1,5 @@
-package Krawfish::Koral::Meta::Sort::Sample;
-use Krawfish::Koral::Meta::Node::Sort::Sample;
+package Krawfish::Koral::Compile::Sort::Sample;
+use Krawfish::Koral::Compile::Node::Sort::Sample;
use Krawfish::Util::String qw/squote/;
use strict;
use warnings;
@@ -40,7 +40,7 @@
sub wrap {
my ($self, $query) = @_;
- return Krawfish::Koral::Meta::Node::Sort::Sample->new(
+ return Krawfish::Koral::Compile::Node::Sort::Sample->new(
$query,
$self->{top_k}
);
diff --git a/lib/Krawfish/Koral/Meta/Type/Key.pm b/lib/Krawfish/Koral/Compile/Type/Key.pm
similarity index 80%
rename from lib/Krawfish/Koral/Meta/Type/Key.pm
rename to lib/Krawfish/Koral/Compile/Type/Key.pm
index b89c92f..c7bcde7 100644
--- a/lib/Krawfish/Koral/Meta/Type/Key.pm
+++ b/lib/Krawfish/Koral/Compile/Type/Key.pm
@@ -1,5 +1,5 @@
-package Krawfish::Koral::Meta::Type::Key;
-use Krawfish::Koral::Meta::Type::KeyID;
+package Krawfish::Koral::Compile::Type::Key;
+use Krawfish::Koral::Compile::Type::KeyID;
use Krawfish::Util::Constants qw':PREFIX';
use strict;
use warnings;
@@ -26,7 +26,7 @@
return unless $term_id;
# Return identifier
- Krawfish::Koral::Meta::Type::KeyID->new(
+ Krawfish::Koral::Compile::Type::KeyID->new(
$term_id
);
};
diff --git a/lib/Krawfish/Koral/Meta/Type/KeyID.pm b/lib/Krawfish/Koral/Compile/Type/KeyID.pm
similarity index 78%
rename from lib/Krawfish/Koral/Meta/Type/KeyID.pm
rename to lib/Krawfish/Koral/Compile/Type/KeyID.pm
index abc7d97..fb94ba5 100644
--- a/lib/Krawfish/Koral/Meta/Type/KeyID.pm
+++ b/lib/Krawfish/Koral/Compile/Type/KeyID.pm
@@ -1,4 +1,4 @@
-package Krawfish::Koral::Meta::Type::KeyID;
+package Krawfish::Koral::Compile::Type::KeyID;
use strict;
use warnings;
diff --git a/lib/Krawfish/Koral/Document/FieldBase.pm b/lib/Krawfish/Koral/Document/FieldBase.pm
index 5d7bd0d..0657f20 100644
--- a/lib/Krawfish/Koral/Document/FieldBase.pm
+++ b/lib/Krawfish/Koral/Document/FieldBase.pm
@@ -7,8 +7,8 @@
use constant DEBUG => 1;
# TODO:
-# Probably use Krawfish::Koral::Meta::Type::KeyID and
-# Krawfish::Koral::Meta::Type::Key.
+# Probably use Krawfish::Koral::Compile::Type::KeyID and
+# Krawfish::Koral::Compile::Type::Key.
sub new {
diff --git a/lib/Krawfish/Koral/Meta/Builder.pm b/lib/Krawfish/Koral/Meta/Builder.pm
deleted file mode 100644
index 577a6dd..0000000
--- a/lib/Krawfish/Koral/Meta/Builder.pm
+++ /dev/null
@@ -1,208 +0,0 @@
-package Krawfish::Koral::Meta::Builder;
-use strict;
-use warnings;
-
-use Krawfish::Koral::Meta::Aggregate;
-
-# TODO:
-# These should all be moved to ::Meta::Cluster::*
-use Krawfish::Koral::Meta::Limit;
-use Krawfish::Koral::Meta::Sort;
-use Krawfish::Koral::Meta::Sort::Field;
-use Krawfish::Koral::Meta::Sort::Sample;
-use Krawfish::Koral::Meta::Aggregate::Frequencies;
-use Krawfish::Koral::Meta::Aggregate::Fields;
-use Krawfish::Koral::Meta::Aggregate::Length;
-use Krawfish::Koral::Meta::Aggregate::Values;
-use Krawfish::Koral::Meta::Group;
-use Krawfish::Koral::Meta::Group::Fields;
-use Krawfish::Koral::Meta::Group::ClassFrequencies;
-
-use Krawfish::Koral::Meta::Enrich;
-use Krawfish::Koral::Meta::Enrich::Terms;
-use Krawfish::Koral::Meta::Enrich::Fields;
-use Krawfish::Koral::Meta::Enrich::Snippet;
-use Krawfish::Koral::Meta::Enrich::Snippet::Context::Span;
-
-use Krawfish::Koral::Meta::Type::Key;
-use Scalar::Util qw/blessed/;
-
-sub new {
- my $class = shift;
- bless [], $class;
-};
-
-# $koral->meta(
-# $mb->aggregate(
-# $mb->a_frequencies,
-# $mb->a_fields('license'),
-# $mb->a_fields('corpus'),
-# $mb->a_length
-# ),
-# $mb->start_index(0),
-# $mn->items_per_page(20)
-# $mb->sort_by(
-# $mb->sort_field('author', 1)
-# ),
-# $mb->fields('author')
-# $mb->snippet('')
-
-sub aggregate {
- my $self = shift;
- return Krawfish::Koral::Meta::Aggregate->new(@_);
-};
-
-# Some aggregation types
-# Aggregate frequencies
-sub a_frequencies {
- return Krawfish::Koral::Meta::Aggregate::Frequencies->new;
-};
-
-
-# Aggregate fields
-sub a_fields {
- shift;
- return Krawfish::Koral::Meta::Aggregate::Fields->new(
- map {
- blessed $_ ? $_ : Krawfish::Koral::Meta::Type::Key->new($_)
- } @_
- );
-};
-
-
-# Aggregate lengths of matches
-sub a_length {
- return Krawfish::Koral::Meta::Aggregate::Length->new;
-};
-
-
-# Aggregate numerical values
-sub a_values {
- shift;
- return Krawfish::Koral::Meta::Aggregate::Values->new(
- map {
- blessed $_ ? $_ : Krawfish::Koral::Meta::Type::Key->new($_)
- } @_
- );
-};
-
-
-# Enrich matched with additional information
-sub enrich {
- shift;
- return Krawfish::Koral::Meta::Enrich->new(@_);
-};
-
-
-# Enrich with fields
-sub e_fields {
- shift;
- return Krawfish::Koral::Meta::Enrich::Fields->new(
- map {
- blessed $_ ? $_ : Krawfish::Koral::Meta::Type::Key->new($_)
- } @_
- );
-};
-
-
-# Enrich with snippets
-sub e_snippet {
- shift;
- # Accepts: left_context => $mb->e_char_context(5)
- return Krawfish::Koral::Meta::Enrich::Snippet->new(@_);
-};
-
-
-# Set char context
-sub e_char_context {
- shift;
- my $count = shift;
- ...
- # return Krawfish::Koral::Meta::Enrich::Snippet::Context::Char->new($count);
-};
-
-
-# Set token context
-sub e_token_context {
- shift;
- my ($count, $foundry) = @_;
- ...
- # return Krawfish::Koral::Meta::Enrich::Snippet::Context::Token->new($count, $foundry);
-};
-
-
-sub e_span_context {
- shift;
- my ($term, $count) = @_;
- return Krawfish::Koral::Meta::Enrich::Snippet::Context::Span->new($term, $count);
-};
-
-# Enrich with Term lists per class
-sub e_terms {
- shift;
- return Krawfish::Koral::Meta::Enrich::Terms->new(@_);
-};
-
-
-# Grouping object
-sub group_by {
- shift;
- return Krawfish::Koral::Meta::Group->new(@_);
-};
-
-
-# Group by fields
-sub g_fields {
- shift;
- return Krawfish::Koral::Meta::Group::Fields->new(
- map {
- blessed $_ ? $_ : Krawfish::Koral::Meta::Type::Key->new($_)
- } @_
- );
-};
-
-
-# Group by class frequencies
-sub g_class_freq {
- shift;
- return Krawfish::Koral::Meta::Group::ClassFrequencies->new(@_);
-};
-
-
-# Sort results by different criteria
-sub sort_by {
- shift;
- return Krawfish::Koral::Meta::Sort->new(@_);
-};
-
-
-# Some sorting criteria
-sub s_field {
- shift;
- return Krawfish::Koral::Meta::Sort::Field->new(
- blessed $_[0] ? $_[0] : Krawfish::Koral::Meta::Type::Key->new($_[0]),
- $_[1]
- );
-};
-
-
-# Get a sample of size X
-sub s_sample {
- shift;
- return Krawfish::Koral::Meta::Sort::Sample->new(shift);
-};
-
-# TODO:
-# s_class (sort by the surface form of a class, necessary for concordances)
-
-
-sub limit {
- shift;
- # start_index, items_per_page
- return Krawfish::Koral::Meta::Limit->new(@_);
-};
-
-
-1;
-
-__END__