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

16
LINES

< > BotCompany Repo | #1011390 // webToStringShort (one line)

JavaX fragment (include)

1  
static S webToStringShort(Web web) {
2  
  try {
3  
    if (web == null) ret "-";
4  
    int n = l(web_nodes(web));
5  
    if (n == 0) ret "Empty web";
6  
    WebNode a = web_firstNode(web);
7  
    if (n == 1) ret join(" = ", web_texts(a));
8  
    if (n == 2) {
9  
      WebNode b = web_secondNode(web);
10  
      ret ai_renderTriple(web_text(a), web_text(web_getRelation(a, b)), web_text(b));
11  
    }
12  
    ret "Includes " + joinWithComma(map web_text(web_nodes(web)));
13  
  } catch print e {
14  
    ret "Error";
15  
  }
16  
}

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: #1011390
Snippet name: webToStringShort (one line)
Eternal ID of this version: #1011390/7
Text MD5: 6e2a250729e302a4b5031144852cc22d
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-22 08:18:30
Source code size: 495 bytes / 16 lines
Pitched / IR pitched: No / No
Views / Downloads: 505 / 515
Version history: 6 change(s)
Referenced in: [show references]