Warning: session_start(): open(/var/lib/php/sessions/sess_2nqsjl2kchaa3ullk7sc5oartl, 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
!7
cprint SnippetsDeepWordIndex {
transient DeepWordIndex wordIndex; // string = snippet ID
start-thread {
time "Make double word index" {
print("Making index");
new DeepWordIndex wordIndex;
for (virtual CSnippet sn : dm_allSnippets()) {
S snippetID = (S) rcall snippetID(sn);
S text = cast rcall text(sn);
wordIndex.add(snippetID, text);
}
setField(+wordIndex);
}
print("Indexed " + nWords(wordIndex.numWords()));
}
// API
Iterable>> snippetsContainingTextIC_preSearch_withPositions(S query, O... _) {
ret wordIndex == null ? null : wordIndex.lookupString(query, _);
}
}