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

20
LINES

< > BotCompany Repo | #1017425 // Test ai_matchParseTrees

JavaX source code (desktop) [tags: use-pretranspiled] - run with: x30.jar

Download Jar. Uses 3874K of libraries. Click here for Pure Java version (10957L/80K).

!7

p-exp {
  for (Pair<S> p : ll(
    pair("I called my mother", "I called my brother"),
    pair("It's time for tea", "What time is it"))) {
    print("\n" + p);
    PTElement tree1 = ai_parseBottomUpToTree(p.a);
    PTElement tree2 = ai_parseBottomUpToTree(p.b);
    
    L<Pair<PTElement>> matches = ai_matchParseTrees(tree1, tree2);
    //pnl(flattenListOfPairs(matches));
    
    // Quick&Dirty matching using PTElement.toString()
    matches = dropPairsWithSameToStringOnBothSidesIC(matches);
    
    //print("\nSimplified.");
    pnl(flattenListOfPairs(matches));
  }
}

Author comment

Began life as a copy of #1017421

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: #1017425
Snippet name: Test ai_matchParseTrees
Eternal ID of this version: #1017425/4
Text MD5: b1ebbff413fb0730df1189200b03b1ac
Transpilation MD5: 65e6ea00517ce4fad0bbc453bad517e8
Author: stefan
Category: javax / a.i.
Type: JavaX source code (desktop)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-07-20 14:58:21
Source code size: 598 bytes / 20 lines
Pitched / IR pitched: No / No
Views / Downloads: 305 / 663
Version history: 3 change(s)
Referenced in: [show references]