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

31
LINES

< > BotCompany Repo | #1017329 // Teach The English Parser [dev.]

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

Libraryless. Click here for Pure Java version (17734L/128K).

1  
!7
2  
3  
sclass ButtonsForParser extends DynSCP {
4  
  start {
5  
    dm_useLocallyCopiedMechLists();
6  
    doEveryAndNow(5000, r actualUpdate);
7  
  }
8  
  
9  
  void actualUpdate {
10  
    temp enter();
11  
    O parser = dm_moduleOfType("EnglishParser");
12  
    //print("Parser: " + parser);
13  
    if (parser == null) ret;
14  
    Pair<S, L<ParseResult1>> p = (Pair) quickImport(
15  
    getOpt(parser, 'lastResults));
16  
    if (p == null) ret;
17  
    Container stack = dynamicVStack2();
18  
    new Set<PairS> seen;
19  
    for (ParseResult1 r : p.b)
20  
      for (final PairS a : r.assumptions) {
21  
        if (!isAngleBracketed(a.a)) continue;
22  
        if (!seen.add(a)) continue;
23  
        //print("Got assumption: " + a);
24  
        add(stack, centerAndEastWithMargins(jlabel("Assumption: "+ a), jbutton("Confirm", r {
25  
          Set<S> listNames = ai_mechListNamesForAngleBracketCategory(a.a);
26  
          print("Should add " + quote(a.b) + " to " + listNames);
27  
        })));
28  
      }
29  
    setComponent(stack);
30  
  }
31  
}

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: #1017329
Snippet name: Teach The English Parser [dev.]
Eternal ID of this version: #1017329/16
Text MD5: 465231893639afdf38e09912c0cf0e1c
Transpilation MD5: 950e84dfc89d4109b17c03a0a4d7d04f
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-17 16:53:52
Source code size: 983 bytes / 31 lines
Pitched / IR pitched: No / No
Views / Downloads: 332 / 478
Version history: 15 change(s)
Referenced in: [show references]