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

34
LINES

< > BotCompany Repo | #1017376 // English Parser w/simplification [OK]

JavaX source code (Dynamic Module) [tags: use-pretranspiled] - run with: Stefan's OS

Libraryless. Click here for Pure Java version (19077L/138K).

!7

set flag DynModule. // for transpilation

sclass BottomUpParser > DynPrintLogWithInput {
  transient S lastOutput;
  
  start {
    dm_useLocallyCopiedMechLists(); set flag NoFancyMechParsing.
    ai_parser_activateStandardFunctions();
    doEvery(5000, r { if (dm_isShowingAndOSInForeground()) update(inputChooser.input()) });
  }
  
  void update(fS s) {
    temp enter();
    
    S rendered = hijackPrint(r {
      print("\n> " + s + "\n");
      PTElement root = ai_parseToTreeWithGuessing(s); //ai_parseBottomUpToTree(s);
      if (root == null) ret with print("No parse");
      print("Have parse: " + className(root) + " - " + root);
      
      print("SIMPLIFIED > " + ai_parseTree_simplifiedText(root));
      print();
      
      Collection<S> all = ai_parseTree_simplifiedTexts(root);
      pnl(all);
    });

    bool shouldPrint = neq(rendered, lastOutput);
    lastOutput = rendered;
    if (shouldPrint) print(rendered);
  }
}

Author comment

Began life as a copy of #1017355

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1017376
Snippet name: English Parser w/simplification [OK]
Eternal ID of this version: #1017376/35
Text MD5: 406788a95171714aa64ce7a0124d384a
Transpilation MD5: 838314dbb1d41cda8a4b9febc3e3b2e0
Author: stefan
Category: javax / a.i.
Type: JavaX source code (Dynamic Module)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-08-02 11:37:21
Source code size: 981 bytes / 34 lines
Pitched / IR pitched: No / No
Views / Downloads: 450 / 1826
Version history: 34 change(s)
Referenced in: [show references]