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

17
LINES

< > BotCompany Repo | #1022310 // fullPhraseCache_group

JavaX fragment (include)

static LS fullPhraseCache_group(FullPhraseCache cache, LS tok) {
  if (cache == null) ret tok;
  tok = cloneList(tok);
  for (int i = 1; i < l(tok); i += 2) {
    int j = fullPhraseCache_longestPhraseLength(cache, tok, i);
    if (j > i) {
      j -= 2;
      tok_addCurlyBracketsAroundPart(tok, i, j);
      i = j;
    }
  }
  ret tok;
}

sS fullPhraseCache_group(FullPhraseCache cache, S s) {
  ret join(fullPhraseCache_group(cache, javaTokNPunctuation(s)));
}

Author comment

Began life as a copy of #1022272

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: #1022310
Snippet name: fullPhraseCache_group
Eternal ID of this version: #1022310/1
Text MD5: 783b553f6f850db9fdb5265993f168ab
Author: stefan
Category: javax / a.i.
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-03-13 05:40:04
Source code size: 478 bytes / 17 lines
Pitched / IR pitched: No / No
Views / Downloads: 276 / 305
Referenced in: #1006654 - Standard functions list 2 (LIVE, continuation of #761)
#1023777 - fullPhraseCache_intRanges - int ranges end after last C token of phrase