Uses 911K of libraries. Click here for Pure Java version (2723L/15K).
1 | !7 |
2 | |
3 | cmodule Spike > DynPrintLog {
|
4 | start-thread {
|
5 | // Often people can't see well in a concert when someone tall is in front of them. |
6 | |
7 | S s = winograd_takeFirstOption( |
8 | "John couldn't see the stage with Billy in front of him because he is so [short/tall]. Who is so [short/tall]?"); |
9 | //LS sentences = sentences(s); |
10 | LS tok = javaTok(s); |
11 | Set<S> names = dm_getUnclearListAsCISet("First names");
|
12 | Set<S> pronouns = dm_getUnclearListAsCISet("Pronouns");
|
13 | |
14 | Set<S> foundNames = ciSet(); |
15 | |
16 | for (int i = 1; i < l(tok); i += 2) {
|
17 | S t = tok.get(i); |
18 | print(t); |
19 | if (contains(names, t)) { print(" NAME"); foundNames.add(t); }
|
20 | if (contains(pronouns, t)) print(" PRONOUN. May be one of: " + foundNames);
|
21 | } |
22 | } |
23 | } |
download show line numbers debug dex old transpilations
Travelled to 7 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt, xrpafgyirdlv
No comments. add comment
| Snippet ID: | #1027103 |
| Snippet name: | Winograd Pronoun Resolution Spike |
| Eternal ID of this version: | #1027103/4 |
| Text MD5: | 2cfc55eec9a7705ce9b3eb51702a63c2 |
| Transpilation MD5: | 6d9c94b8692faefa69222236a393534e |
| Author: | stefan |
| Category: | javax / a.i. |
| Type: | JavaX source code (Dynamic Module) |
| Public (visible to everyone): | Yes |
| Archived (hidden from active list): | No |
| Created/modified: | 2020-02-19 14:58:45 |
| Source code size: | 790 bytes / 23 lines |
| Pitched / IR pitched: | No / No |
| Views / Downloads: | 500 / 1061 |
| Version history: | 3 change(s) |
| Referenced in: | [show references] |