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

12
LINES

< > BotCompany Repo | #1026589 // wordRangesIterator - all word ranges (without full by default)

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

Libraryless. Click here for Pure Java version (3100L/19K).

1  
static ItIt<S> wordRangesIterator(S s, O... _) {
2  
  ret wordRangesIterator(javaTokNPunctuationWithBrackets(s), _);
3  
}
4  
5  
static ItIt<S> wordRangesIterator(LS tok, O... _) {
6  
  boolPar plusFull;
7  
  int n = countTokens(tok);
8  
  ret nestedIterator(
9  
    countIterator_exclusive(0, n), from -> mapI(
10  
    countIterator_inclusive(from+1, from == 0 && !plusFull ? n-1 : n), to ->
11  
      wordRange(tok, from, to)));
12  
}

Author comment

Began life as a copy of #1026527

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: #1026589
Snippet name: wordRangesIterator - all word ranges (without full by default)
Eternal ID of this version: #1026589/5
Text MD5: 02d7b2ac5399f6fa28ccdc04be9ee665
Transpilation MD5: 88ff7f0abf0de43a262b40090c4bb3c7
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:57:52
Source code size: 411 bytes / 12 lines
Pitched / IR pitched: No / No
Views / Downloads: 156 / 242
Version history: 4 change(s)
Referenced in: [show references]