Uses 911K of libraries. Click here for Pure Java version (7994L/42K).
1 | !7 |
2 | |
3 | cmodule WatchThisTrickMate > DynPrintLog {
|
4 | class FactCondition implements Runnable {
|
5 | S text; |
6 | Runnable action; |
7 | |
8 | *() {}
|
9 | *(S *text, Runnable *action) {}
|
10 | |
11 | run {
|
12 | } |
13 | |
14 | toString { ret "if {" + text + "} => " + action; }
|
15 | } |
16 | |
17 | start-thread {
|
18 | dm_useLocalMechListCopies(); |
19 | |
20 | /*L<WordTokRule> rules = map wordTokReplacerRuleOnXY(splitAtEmptyLines([[ |
21 | [heard] you must watch {this trick}
|
22 | => [implied] {this trick} is very good
|
23 | |
24 | [heard] you must watch {this trick}
|
25 | + [fact] i have watched {this trick}
|
26 | => [say] Thanks, I've seen it already |
27 | |
28 | [heard] you must watch {this trick}
|
29 | + [fact] i have not watched {this trick}
|
30 | => [say] Well... I haven't seen it yet, so maybe I should |
31 | ]]));*/ |
32 | |
33 | new L<Runnable> continuations; |
34 | |
35 | L<WordTokRule> rules = ll( |
36 | WordTokReplacer_es1( |
37 | "[heard] you must watch {this trick}", "",
|
38 | "[implied] {this trick} is very good"),
|
39 | |
40 | WordTokReplacer_es1( |
41 | "[heard] you must watch {this trick}", "",
|
42 | "[say] Thanks, I've seen it already") {
|
43 | run {
|
44 | continuations.add(print(new FactCondition("i have watched {this trick}", r emitOut)));
|
45 | } |
46 | } |
47 | ); |
48 | |
49 | S s = "you must watch this trick"; |
50 | |
51 | pnl(extsToString /*uniquifyMap tok_dropCurlyBrackets*/(iterateHull(func(ExtS s) -> L<ExtS> {
|
52 | print("Processing: " + extToString(s));
|
53 | ret listPlusNempties_es( |
54 | applyAttractors_es(rules, ll(s)), |
55 | extMap_verbose tok_dropCurlyBrackets(s), |
56 | extMap_verbose ai_dropFillers1(s), |
57 | extMap_verbose ai_groupTheAdjectiveNoun(s), |
58 | extMap_verbose ai_groupSimplestNounPhrases2(s)); |
59 | }, makeExt(s, type := "heard")))); |
60 | |
61 | print("Have " + n2(continuations, "continuation"));
|
62 | } |
63 | } |
Began life as a copy of #1023502
download show line numbers debug dex old transpilations
Travelled to 7 computer(s): bhatertpkbcr, cfunsshuasjs, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt
No comments. add comment
| Snippet ID: | #1023524 |
| Snippet name: | Watch this trick [logic engine example, dev.] |
| Eternal ID of this version: | #1023524/31 |
| Text MD5: | cfca2b6a0aa0fb1f008a2957d9e1b1f2 |
| Transpilation MD5: | 9702f8e58d4ab8430860bda4a31104f3 |
| Author: | stefan |
| Category: | javax / logic engines |
| Type: | JavaX source code (Dynamic Module) |
| Public (visible to everyone): | Yes |
| Archived (hidden from active list): | No |
| Created/modified: | 2019-06-28 13:06:59 |
| Source code size: | 1896 bytes / 63 lines |
| Pitched / IR pitched: | No / No |
| Views / Downloads: | 601 / 1347 |
| Version history: | 30 change(s) |
| Referenced in: | [show references] |