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

12
LINES

< > BotCompany Repo | #1023777 // fullPhraseCache_intRanges - int ranges end after last C token of phrase

JavaX fragment (include) [tags: use-pretranspiled]

Libraryless. Click here for Pure Java version (2610L/16K).

1  
static L<IntRange> fullPhraseCache_intRanges(FullPhraseCache cache, LS tok) {
2  
  if (cache == null) null;
3  
  new L<IntRange> ranges;
4  
  for (int i = 1; i < l(tok); i += 2) {
5  
    int j = fullPhraseCache_longestPhraseLength(cache, tok, i);
6  
    if (j > i) {
7  
      ranges.add(intRange(i, j-1));
8  
      i = j-2;
9  
    }
10  
  }
11  
  ret ranges;
12  
}

Author comment

Began life as a copy of #1022310

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1023777
Snippet name: fullPhraseCache_intRanges - int ranges end after last C token of phrase
Eternal ID of this version: #1023777/6
Text MD5: 48f086dccce884d8d489d60076d85ae5
Transpilation MD5: b58082848cf1aacfdf78a1a1f74a7c29
Author: stefan
Category: javax / a.i.
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-07-09 13:02:08
Source code size: 339 bytes / 12 lines
Pitched / IR pitched: No / No
Views / Downloads: 144 / 221
Version history: 5 change(s)
Referenced in: [show references]