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

16
LINES

< > BotCompany Repo | #1017561 // tok_combineUpperCasePhrases

JavaX fragment (include)

static L<S> tok_combineUpperCasePhrases(L<S> tok) {
  new L<S> l;
  for i over tok: {
    S t = tok.get(i);
    if (odd(i) && onlyLettersAndAllUpperCase(t)) {
      int j = i;
      while (j+2 < l(tok) && onlyLettersAndAllUpperCase(tok.get(j+2)))
        j += 2;
      if (j > i)
        l.add(joinSubList(tok, i, j+1));
      i = j;
    } else
      l.add(t);
  }
  ret l;
}

Author comment

Began life as a copy of #1012539

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1017561
Snippet name: tok_combineUpperCasePhrases
Eternal ID of this version: #1017561/3
Text MD5: e2d79973469e827d20829d47c93db0d9
Author: stefan
Category: javax / parsing
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-07-27 13:24:26
Source code size: 390 bytes / 16 lines
Pitched / IR pitched: No / No
Views / Downloads: 374 / 411
Version history: 2 change(s)
Referenced in: #1006654 - Standard functions list 2 (LIVE, continuation of #761)
#1017562 - tok_combineUpperCasePhrases_curly