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))); }