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

19
LINES

< > BotCompany Repo | #1005497 // testParse + parseToOptions using unrollOptions

JavaX fragment (include)

svoid testParse(S s) {
  print("** \* s */ **");
  print();
  Concept parsed = parseToOptions(s);
  print("Parse concept graph size: " + conceptGraphSize(parsed));
  L<Concept> l = unrollOptions(parsed);
  for i over l: {
    Concept x = l.get(i);
    bool prop = properSentence(x);
    print((prop ? "! " : "") + (i+1) + ". " + structureConcept(x));
  }
  print();
}

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

Author comment

Began life as a copy of #1005484

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1005497
Snippet name: testParse + parseToOptions using unrollOptions
Eternal ID of this version: #1005497/1
Text MD5: aa5672252ebfb1a4d6c582e5b4f97ec8
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-24 00:23:13
Source code size: 493 bytes / 19 lines
Pitched / IR pitched: No / No
Views / Downloads: 579 / 1076
Referenced in: #1005487 - Parse Sentence Multi 3, unrollOptions [works]
#1005502 - Parse Sentence Multi 4, using (a|b) syntax [works]
#1005508 - Parse Sentence Multi 5, using rules [WORKS]