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).

1  
!7
2  
3  
set flag DynModule. // for transpilation
4  
5  
sclass BottomUpParser > DynPrintLogWithInput {
6  
  transient S lastOutput;
7  
  
8  
  start {
9  
    dm_useLocallyCopiedMechLists(); set flag NoFancyMechParsing.
10  
    ai_parser_activateStandardFunctions();
11  
    doEvery(5000, r { if (dm_isShowingAndOSInForeground()) update(inputChooser.input()) });
12  
  }
13  
  
14  
  void update(fS s) {
15  
    temp enter();
16  
    
17  
    S rendered = hijackPrint(r {
18  
      print("\n> " + s + "\n");
19  
      PTElement root = ai_parseToTreeWithGuessing(s); //ai_parseBottomUpToTree(s);
20  
      if (root == null) ret with print("No parse");
21  
      print("Have parse: " + className(root) + " - " + root);
22  
      
23  
      print("SIMPLIFIED > " + ai_parseTree_simplifiedText(root));
24  
      print();
25  
      
26  
      Collection<S> all = ai_parseTree_simplifiedTexts(root);
27  
      pnl(all);
28  
    });
29  
30  
    bool shouldPrint = neq(rendered, lastOutput);
31  
    lastOutput = rendered;
32  
    if (shouldPrint) print(rendered);
33  
  }
34  
}

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: 489 / 1874
Version history: 34 change(s)
Referenced in: [show references]