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

8
LINES

< > BotCompany Repo | #1026614 // wordIntRangesIterator_shortestFirst - all word ranges as IntRange (without full by default)

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

Transpiled version (2723L) is out of date.

static ItIt<IntRange> wordIntRangesIterator_shortestFirst(LS tok, O... _) {
  boolPar plusFull;
  int n = countTokens(tok);
  ret nestedIterator(
    countIterator_inclusive(1, plusFull ? n : n-1), length -> mapI(
      countIterator_inclusive(0, n-length), from ->
        IntRange(from, from+length)));
}

Author comment

Began life as a copy of #1026606

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: #1026614
Snippet name: wordIntRangesIterator_shortestFirst - all word ranges as IntRange (without full by default)
Eternal ID of this version: #1026614/3
Text MD5: 5cae2427e1046a3d5c8147c72471a1d1
Author: stefan
Category: javax / nlp
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2020-01-16 18:17:36
Source code size: 313 bytes / 8 lines
Pitched / IR pitched: No / No
Views / Downloads: 185 / 262
Version history: 2 change(s)
Referenced in: [show references]