1 | static L<IfThen> nlLogic_applyMetaRules(L<IfThen> rules) {
|
2 | final L<IfThen> metaRules = nlLogic_filterByRHSConstructs(rules, 'construct); |
3 | if (empty(metaRules)) ret rules; |
4 | |
5 | new L<IfThen> newRules; |
6 | for (IfThen rule : rules) |
7 | newRules.add(nlLogic_transformShallow(rule, func(Exp e) -> Exp {
|
8 | if (!e instanceof Sentence2) ret e; |
9 | final new NLLogic_ConstructChecker c; |
10 | S original = e.text(); |
11 | c.construct = original; |
12 | applyNLLogicFacts_v3(c, voidfunc(Exp e) {
|
13 | if (e cast Func) |
14 | if (eq(e.name, 'construct)) |
15 | c.construct = e.arg.text(); |
16 | }, metaRules); |
17 | ret eq(c.construct, original) ? e : nlLogic_parseExpression(c.construct); |
18 | })); |
19 | ret newRules; |
20 | } |
download show line numbers debug dex old transpilations
Travelled to 13 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, irmadwmeruwu, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt
No comments. add comment
| Snippet ID: | #1018293 |
| Snippet name: | nlLogic_applyMetaRules |
| Eternal ID of this version: | #1018293/4 |
| Text MD5: | 87b7489cae306053557903a2d372ab47 |
| Author: | stefan |
| Category: | javax / a.i. |
| Type: | JavaX fragment (include) |
| Public (visible to everyone): | Yes |
| Archived (hidden from active list): | No |
| Created/modified: | 2018-09-16 12:31:03 |
| Source code size: | 749 bytes / 20 lines |
| Pitched / IR pitched: | No / No |
| Views / Downloads: | 606 / 644 |
| Version history: | 3 change(s) |
| Referenced in: | [show references] |