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

7
LINES

< > BotCompany Repo | #1028084 // subtokenizationsOfAnyLength (OK)

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

Libraryless. Click here for Pure Java version (2862L/18K).

1  
// returns actual CNC
2  
static ItIt<LS> subtokenizationsOfAnyLength(LS tok) {
3  
  int n = countTokens(tok);
4  
  ret nestedIterator(countIterator_inclusive(1, n), length -> // how many tokens to get
5  
    mapI(countIterator_inclusive(0, n-length), i -> // first token to get
6  
      subList(tok, i*2, (i+length)*2+1)));
7  
}

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1028084
Snippet name: subtokenizationsOfAnyLength (OK)
Eternal ID of this version: #1028084/4
Text MD5: 01451105478db1fc79baac278ac2f94f
Transpilation MD5: c4fbb474dbbd16e7e97be0f286c9bdbd
Author: stefan
Category: javax / a.i.
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2020-05-17 16:20:34
Source code size: 316 bytes / 7 lines
Pitched / IR pitched: No / No
Views / Downloads: 148 / 214
Version history: 3 change(s)
Referenced in: [show references]