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

29
LINES

< > BotCompany Repo | #1017395 // English Parse Tree With Weights [OK]

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

Libraryless. Click here for Pure Java version (18685L/136K).

!7

sclass BottomUpParser > DynSCPWithInput {
  start {
    set flag DynModule. // for transpilation
    dm_useLocallyCopiedMechLists(); set flag NoFancyMechParsing.
    ai_parser_activateStandardFunctions();
  }
  
  void update(S s) {
    temp enter();
    if (!isShowing()) { inputChooser.forgetInput(); ret; }
    
    final new AI_BottomUpParser1 parser;
    parser.parse(s);
    AI_BottomUpParser1.Word w = parser.fullGroup();
    print("Full group: " + w);
    if (w == null) ret;
    final L<WeightedProduction> productions = ai_buParser_parseWeightedProductions();
    print("Have " + n2(productions, "production"));
    
    print("Classes: " + sfu(w.classes));
    ChooseCategory root = new(w, withoutQuoted(w.classes));
    ai_parseTree_makeWeights(parser, productions, root);
    ai_parseTree_makeTotalWeights(root, 1);
    
    setComponent(jDynamicTree(root, func(final PTElement e) -> L<PTElement> { e.children }));
  }
}

Author comment

Began life as a copy of #1017392

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1017395
Snippet name: English Parse Tree With Weights [OK]
Eternal ID of this version: #1017395/15
Text MD5: 84987853783bb49f5f9b77ecd1d35a67
Transpilation MD5: 19f44e673ede188606038456ec51cf18
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-07-20 12:43:01
Source code size: 965 bytes / 29 lines
Pitched / IR pitched: No / No
Views / Downloads: 330 / 977
Version history: 14 change(s)
Referenced in: [show references]