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

8
LINES

< > BotCompany Repo | #1026606 - wordIntRangesIterator - all word ranges as IntRange (without full by default)

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

Libraryless. Click here for Pure Java version (2723L/17K).

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

Author comment

Began life as a copy of #1026589

download  show line numbers  debug dex   

Travelled to 3 computer(s): mqqgnosmbjvj, tvejysmllsmz, xrpafgyirdlv

No comments. add comment

Snippet ID: #1026606
Snippet name: wordIntRangesIterator - all word ranges as IntRange (without full by default)
Eternal ID of this version: #1026606/5
Text MD5: 244f31d8690f9fdfdd3e0298f054a972
Transpilation MD5: d5ae0de71cb4107d36d937ed8bf3d5be
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 14:55:42
Source code size: 298 bytes / 8 lines
Pitched / IR pitched: No / No
Views / Downloads: 14 / 34
Version history: 4 change(s)
Referenced in: [show references]

Formerly at http://tinybrain.de/1026606 & http://1026606.tinybrain.de