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

9
LINES

< > BotCompany Repo | #1022960 // tok_moveWordToWhitespace

JavaX fragment (include)

1  
static LS tok_moveWordToWhitespace(S word, LS tok) {
2  
  tok = cloneList(tok);
3  
  for (int i = 1; i < l(tok); i += 2)
4  
    if (eqic(get(tok, i), word)) {
5  
      replaceSubList(tok, i-1, i+2, ll(joinSubList(tok, i-1, i+2)));
6  
      i -= 2;
7  
    }
8  
  ret tok;
9  
}

Author comment

Began life as a copy of #1021988

download  show line numbers  debug dex  old transpilations   

Travelled to 7 computer(s): bhatertpkbcr, cfunsshuasjs, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1022960
Snippet name: tok_moveWordToWhitespace
Eternal ID of this version: #1022960/3
Text MD5: e3b09f04bc9c48fbd692c52f5bdba26f
Author: stefan
Category: javax / a.i.
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-04-15 20:23:34
Source code size: 259 bytes / 9 lines
Pitched / IR pitched: No / No
Views / Downloads: 277 / 308
Version history: 2 change(s)
Referenced in: [show references]