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

31
LINES

< > BotCompany Repo | #1028892 // Find Entities Spike

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

Uses 911K of libraries. Click here for Pure Java version (7989L/40K).

!7

cprint {
  start-thread {
    dm_useLocalMechListCopies();
  
    S s = "if a snippet contains token X, it also contains token Y";
    LS tok = javaTok(s);
    L<ParsedWithTokens<S>> pronouns = pwt_allPronouns(tok);
    print("Pronouns", pronouns);
    for (ParsedWithTokens<S> p : pronouns) p.replaceTokens("bla");
    print(join(tok));
    //print(first(ai_pronounResolvedToNLA(s)));
    //ret ai_parseIfThen(s);
    
    new RecordCalls rec;
    for (PairS p : getVars(ai_findNounPlusVar(s)))
      rec.get("addEntity", joinPairWithSpace(p));
    for (DeterminerPlusNoun x : getVars(ai_findSimplestNounPhrases(s)))
      rec.get("addEntity", x.render());
    
    print(rec);
    LS entities = secondOfListsWhereFirstEqic("addEntity", rec.calls);
    
    VarMaker entityNameMaker = entityNameMaker(s);
    SS map = freshVarsMap(entities, entityNameMaker);
    print(s = replacePhrases(s, map));
    
    print(ai_parseIfThen(s));
  }
}

download  show line numbers  debug dex  old transpilations   

Travelled to 7 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt, xrpafgyirdlv

No comments. add comment

-
Snippet ID: #1028892
Snippet name: Find Entities Spike
Eternal ID of this version: #1028892/1
Text MD5: 7625883901caa95560f5a2692d935895
Transpilation MD5: 0606d3e1b9e9ed359157430b277f8f96
Author: stefan
Category: javax
Type: JavaX source code (Dynamic Module)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2020-07-10 19:55:26
Source code size: 973 bytes / 31 lines
Pitched / IR pitched: No / No
Views / Downloads: 227 / 309
Referenced in: