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

15
LINES

< > BotCompany Repo | #1008351 // addConceptIDs - transform "? - " into a new ID

JavaX fragment (include)

1  
static S addConceptIDs(S bla) {
2  
  L<S> lines = toLines(bla);
3  
  bool change = false;
4  
  for i over lines: {
5  
    L<S> tok = javaTok(lines.get(i));
6  
    int idx = jfind(tok, "? -");
7  
    //print(lines.get(i) + " => " + idx);
8  
    if (idx == 1) {
9  
      tok.set(1, aGlobalID());
10  
      lines.set(i, join(tok));
11  
      change = true;
12  
    }
13  
  }
14  
  ret change ? fromLines(lines) : bla;
15  
}

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: #1008351
Snippet name: addConceptIDs - transform "? - " into a new ID
Eternal ID of this version: #1008351/5
Text MD5: b44f589abf39a836eff612e5afafd95a
Author: stefan
Category: javax / a.i.
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2017-05-09 15:09:59
Source code size: 386 bytes / 15 lines
Pitched / IR pitched: No / No
Views / Downloads: 528 / 526
Version history: 4 change(s)
Referenced in: [show references]