Download Jar. Uses 3874K of libraries. Click here for Pure Java version (11000L/80K).
1 | !7 |
2 | |
3 | p-exp { |
4 | PTElement tree1 = ai_parseBottomUpToTree("I called my mother"); |
5 | PTElement tree2 = ai_parseBottomUpToTree("I called my brother"); |
6 | |
7 | print(); |
8 | matchTrees(tree1, tree2); |
9 | } |
10 | |
11 | svoid matchTrees(PTElement a, PTElement b) { |
12 | PTElement a2 = ai_parseTree_descendToComposite(a); |
13 | PTElement b2 = ai_parseTree_descendToComposite(b); |
14 | |
15 | if (isNull(a2) != isNull(b2)) |
16 | ret with print("Composite vs non-composite: " + or(a2, a) + " / " + or(b2, b)); |
17 | |
18 | if (a2 == null) { |
19 | print("Non-composites: " + a); |
20 | print(" " + b); |
21 | ret; |
22 | } |
23 | |
24 | print("Composites: " + a2); |
25 | print(" " + b2); |
26 | temp tempIndent(); |
27 | print(); |
28 | matchTrees(first(a2.children), first(b2.children)); |
29 | print(); |
30 | matchTrees(second(a2.children), second(b2.children)); |
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: | #1017421 |
Snippet name: | Scan 2 parse trees in parallel Spike [OK] |
Eternal ID of this version: | #1017421/12 |
Text MD5: | 9a4ae7935f88b9bdd0a86348e4fa0604 |
Transpilation MD5: | cf4e9628937d639bce21e351acfd8a64 |
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:43:07 |
Source code size: | 817 bytes / 31 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 416 / 979 |
Version history: | 11 change(s) |
Referenced in: | [show references] |