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

29
LINES

< > TinyBrain | #1017471 - English Bottom-Up Parser v2 (with guessing, dev.)

JavaX source code (Dynamic Module) [tags: use-pretranspiled]

Transpiled version (10570L) is out of date.

!7

sclass BottomUpParser > DynPrintLogWithInput {
  transient S lastOutput;
  
  start {
    set flag DynModule. set flag NoFancyMechParsing.
    dm_useLocallyCopiedMechLists();
    
    // In case lists change
    doEvery(5000, r { update(inputChooser.input()) });
  }
  
  void update(fS s) {
    temp enter();
    
    //print("updating");
    
    S rendered = hijackPrint(r {
      AI_BottomUpParser1 parser = ai_parseToTreeWithGuessing(s);
      parser.printWordsAndGroups();
      parser.printConstituentsOfFullGroup();
    });

    bool shouldPrint = neq(rendered, lastOutput);
    lastOutput = rendered;
    if (shouldPrint) print("\n> " + s + "\n" + rendered);
  }
}

Author comment

Began life as a copy of #1017355

download  show line numbers  debug dex   

Travelled to 10 computer(s): aoiabmzegqzx, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, irmadwmeruwu, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, tslmcundralx, tvejysmllsmz

No comments. add comment

Snippet ID: #1017471
Snippet name: English Bottom-Up Parser v2 (with guessing, dev.)
Eternal ID of this version: #1017471/4
Text MD5: e8b505ec5068008b763886274ba54db6
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-09-11 16:54:16
Source code size: 705 bytes / 29 lines
Pitched / IR pitched: No / No
Views / Downloads: 63 / 77
Version history: 3 change(s)
Referenced in: [show]