Uses 911K of libraries. Click here for Pure Java version (4043L/20K).
!7 cprint SnippetsWordIndex { transient WordIndex<S> wordIndex; // word to snippet ID start-thread { time "Make word index" { new WordIndex<S> 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 // may return null (no pre-search result) Cl<S> snippetsContainingTextIC_preSearch(S query) { ret wordIndex_lookupString(wordIndex, query); } }
Began life as a copy of #1028945
download show line numbers debug dex old transpilations
Travelled to 7 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt, xrpafgyirdlv
No comments. add comment
Snippet ID: | #1028972 |
Snippet name: | Snippets Word Index [OK] |
Eternal ID of this version: | #1028972/7 |
Text MD5: | 497fc56a2d28ac67b2eb04c53ed0a751 |
Transpilation MD5: | 561526dc93a785113154d16f6f450650 |
Author: | stefan |
Category: | javax |
Type: | JavaX source code (Dynamic Module) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2020-07-15 02:04:32 |
Source code size: | 642 bytes / 25 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 262 / 2650 |
Version history: | 6 change(s) |
Referenced in: | #1028975 - Instant Full-Text Snippet Search v2 [using word index, seems OK] #1029008 - Snippets Double Word Index [OK] #1029074 - Word Index Histogram |