1 | static LS fullPhraseCache_group(FullPhraseCache cache, LS tok) { |
2 | if (cache == null) ret tok; |
3 | tok = cloneList(tok); |
4 | for (int i = 1; i < l(tok); i += 2) { |
5 | int j = fullPhraseCache_longestPhraseLength(cache, tok, i); |
6 | if (j > i) { |
7 | j -= 2; |
8 | tok_addCurlyBracketsAroundPart(tok, i, j); |
9 | i = j; |
10 | } |
11 | } |
12 | ret tok; |
13 | } |
14 | |
15 | sS fullPhraseCache_group(FullPhraseCache cache, S s) { |
16 | ret join(fullPhraseCache_group(cache, javaTokNPunctuation(s))); |
17 | } |
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: | 275 / 305 |
Referenced in: | [show references] |