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

26
LINES

< > BotCompany Repo | #1005484 // testParse + parseToOptions + iterateOptions

JavaX fragment (include)

svoid testParse(S s) {
  print("** \* s */ **");
  print();
  new L<Concept> l;
  parse(s, listCollector(l));
  for i over l:
    print((i+1) + ". " + structureConcept(l.get(i)));
  
  for (Concept c : iterateOptions(l)) {
    if (properSentence(c)) {
      print("First proper sentence: " + structureConcept(c));
      break;
    }
  }
  print();
}

static Concept parseToOptions(S s) {
  new L<Concept> l;
  parse(s, listCollector(l));
  ret options(l);
}

static Iterable<Concept> iterateOptions(L<Concept> l) {
  ret mapI(l, func(Concept c) { firstOfFirst(c) });
}

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: #1005484
Snippet name: testParse + parseToOptions + iterateOptions
Eternal ID of this version: #1005484/1
Text MD5: 6675562bc342a0206fef53253e436398
Author: stefan
Category: javax / concepts / parsing
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2016-11-22 13:22:22
Source code size: 593 bytes / 26 lines
Pitched / IR pitched: No / No
Views / Downloads: 470 / 470
Referenced in: [show references]