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

17
LINES

< > BotCompany Repo | #1011366 // ai_addWebToIndex

JavaX fragment (include)

1  
static void ai_addWebToIndex(MultiMap<S, WebNode> index, Web web) {
2  
  if (web == null) ret;
3  
  for (WebNode node : web_nodesAndRelations(web))
4  
    for (S text : asSet(node.texts())) {
5  
      S key = ai_shortenForIndex(text);
6  
      bool newText;
7  
      synchronized(index) {
8  
        if (key == text) // unchanged by shortening
9  
          newText = true;
10  
        else
11  
          newText = !web_nodesContainText(index.get(key), text);
12  
        index.put(key, node);
13  
      }
14  
      if (newText)
15  
        ai_onNewIndexedText(text);
16  
    }
17  
}

Author comment

Began life as a copy of #1011347

download  show line numbers  debug dex  old transpilations   

Travelled to 13 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1011366
Snippet name: ai_addWebToIndex
Eternal ID of this version: #1011366/8
Text MD5: 22bd35c6addd015b8550828dbef993e0
Author: stefan
Category: javax / a.i.
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2017-11-10 02:48:39
Source code size: 542 bytes / 17 lines
Pitched / IR pitched: No / No
Views / Downloads: 434 / 469
Version history: 7 change(s)
Referenced in: [show references]