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

36
LINES

< > BotCompany Repo | #1008408 // Try segmenting text [dev.]

JavaX source code [tags: use-pretranspiled] - run with: x30.jar

Libraryless. Click here for Pure Java version (2151L/14K/49K).

1  
!7
2  
3  
p {
4  
  S text = loadSnippet(#1008407);
5  
  for (S line : toLinesFullTrim(text)) {
6  
    if (line.startsWith("#")) continue;
7  
    //print(line);
8  
    printWithRisingIndent(split3(line));
9  
  }
10  
}
11  
12  
static L<S> split1(S s) {
13  
  int i = 0;
14  
  new L<S> l;
15  
  while (i <= l(s)) {
16  
    int j = smartIndexOf(s, ".", i)+1;
17  
    addIfNempty(l, trim(substring(s, i, j)));
18  
    i = j;
19  
  }
20  
  ret l;
21  
}
22  
23  
static L<S> split2x(L<S> s) {
24  
  int i = 0;
25  
  new L<S> l;
26  
  while (i <= l(s)) {
27  
    int j = smartIndexOf(s, ".", i)+1;
28  
    addIfNempty(l, trim(join(subList(s, i, j))));
29  
    i = j;
30  
  }
31  
  ret l;
32  
}
33  
34  
static L<S> split3(S s) {
35  
  ret split2x(nlTok3(s));
36  
}

download  show line numbers  debug dex  old transpilations   

Travelled to 13 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1008408
Snippet name: Try segmenting text [dev.]
Eternal ID of this version: #1008408/7
Text MD5: a74da88dcba9c5838491eb64b1ebf7a4
Transpilation MD5: 13df93f4cb1388f28dc01c6cb5d7cd35
Author: stefan
Category: javax / a.i. parsing
Type: JavaX source code
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2017-05-15 00:37:16
Source code size: 660 bytes / 36 lines
Pitched / IR pitched: No / No
Views / Downloads: 553 / 614
Version history: 6 change(s)
Referenced in: [show references]