Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

7
LINES

< > BotCompany Repo | #1029013 // deepDoubleWordIndex_add

JavaX fragment (include) [tags: use-pretranspiled]

Libraryless. Click here for Pure Java version (3899L/23K).

svoid <A> deepDoubleWordIndex_add(DoubleWordIndex<WithIntArray<A>> wordIndex, A id, S text) {
  MultiMap<S, Int> positions = ciMultiMap();
  for (IntRange r : wordIndex.wordRanges(text))
    positions.put(substring(text, r), r.start);
  for (S word, L<Int> indices : positions.asMap())
    wordIndex.addWord(new WithIntArray<A>(toIntArray(indices), id), word);
}

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: #1029013
Snippet name: deepDoubleWordIndex_add
Eternal ID of this version: #1029013/2
Text MD5: 6d6927ec01c055e3718c374c962b5d3a
Transpilation MD5: ce3d8e3319e4658b55dbfd653838f147
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2020-07-16 21:55:35
Source code size: 368 bytes / 7 lines
Pitched / IR pitched: No / No
Views / Downloads: 190 / 259
Version history: 1 change(s)
Referenced in: [show references]