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


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


cprint {
  start-thread {
    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");
    //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());
    LS entities = secondOfListsWhereFirstEqic("addEntity", rec.calls);
    VarMaker entityNameMaker = entityNameMaker(s);
    SS map = freshVarsMap(entities, entityNameMaker);
    print(s = replacePhrases(s, map));

download  show line numbers  debug dex   

Travelled to 6 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, 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: 35 / 58
Referenced in: [show references]

Formerly at &