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

17
LINES

< > BotCompany Repo | #1011366 // ai_addWebToIndex

JavaX fragment (include)

static void ai_addWebToIndex(MultiMap<S, WebNode> index, Web web) {
  if (web == null) ret;
  for (WebNode node : web_nodesAndRelations(web))
    for (S text : asSet(node.texts())) {
      S key = ai_shortenForIndex(text);
      bool newText;
      synchronized(index) {
        if (key == text) // unchanged by shortening
          newText = true;
        else
          newText = !web_nodesContainText(index.get(key), text);
        index.put(key, node);
      }
      if (newText)
        ai_onNewIndexedText(text);
    }
}

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: 363 / 393
Version history: 7 change(s)
Referenced in: [show references]