blob: de7a9444dc359f5ef917def39abdcb0769e5605d [file] [log] [blame]
Akron9dcb4f22017-07-04 12:32:13 +02001package Krawfish::Koral::Corpus::Static;
Akronacde0ba2017-12-08 14:05:13 +01002use Role::Tiny::With;
Akron9dcb4f22017-07-04 12:32:13 +02003use strict;
4use warnings;
5
Akronacde0ba2017-12-08 14:05:13 +01006with 'Krawfish::Koral::Corpus';
7
Akron9dcb4f22017-07-04 12:32:13 +02008# Accepts an identifier to a static virtual corpus query
9# (e.g. a list of text/Siglen), represented as a normalized
10# KoralQuery file on disc.
11
12sub new {
13 my $class = shift;
14 bless {
15 id => shift
16 }, $class;
17};
18
19# Do nothing
20sub normalize {
21 $_[0];
22};
23
24# Check if the ID is cached. In case it is cached,
25# Return the cache query.
Akron290f59f2017-08-17 21:55:07 +020026sub memoize {
27 ...
28};
Akron9dcb4f22017-07-04 12:32:13 +020029
30# Load the KoralQuery file, optimize the query,
31# and wrap it in a cache for the next type it is consulted.
32# The query is already normalized.
33# This should only be loaded by some segments with updates.
Akron290f59f2017-08-17 21:55:07 +020034sub optimize {
35 ...
36};
Akron9dcb4f22017-07-04 12:32:13 +020037
38
Akron290f59f2017-08-17 21:55:07 +020039sub operands {
40 ...
41};
Akron4f9eef42017-07-24 11:41:09 +020042
Akron9dcb4f22017-07-04 12:32:13 +0200431;