Warning: session_start(): open(/var/lib/php/sessions/sess_i7l3don94tenecivqi8slo6n94, O_RDWR) failed: No space left on device (28) in /var/www/tb-usercake/models/config.php on line 51
Warning: session_start(): Failed to read session data: files (path: /var/lib/php/sessions) in /var/www/tb-usercake/models/config.php on line 51
// clever index of tokenized strings
// maintaining one CI-sorted list per token position
sclass PositionalTokenIndex2 {
new L indices; // index = token count
*() {}
*(Iterable toks) { addAll(toks); }
void addAll(Iterable toks) {
fOr (LS tok : toks)
add(tok);
}
void add(LS tok) {
listGetOrCreate_full PositionalTokenIndex(indices, l(tok)/2).add(tok);
}
// return all tokenizations with token t in position i
// having tokenCount code tokens
// may return null
LLS byToken(int i, S t, int tokenCount) {
PositionalTokenIndex idx = get(indices, tokenCount);
ret idx == null ? null : idx.byToken(i, t);
}
PositionalTokenIndex indexForTokenCount(int tokenCount) {
ret get(indices, tokenCount);
}
void clean() {
for (PositionalTokenIndex idx : indices) idx.clean();
}
}