Uses 911K of libraries. Click here for Pure Java version (16849L/99K).
1 | !7 |
2 | |
3 | sclass Entry { |
4 | long msgID; |
5 | S originalLine; |
6 | S interpretableText; |
7 | S ruleID; |
8 | //S matchedRuleStruct; |
9 | |
10 | sS _fieldOrder = "msgID originalLine interpretableText"; |
11 | } |
12 | |
13 | set flag DynModule. |
14 | |
15 | cmodule InterpretableTest > DynObjectTable<Entry> { |
16 | transient int maxInterpretablesPerLine = 20; |
17 | |
18 | start { |
19 | addCountToName(); |
20 | thread { scan(); } |
21 | } |
22 | |
23 | visualize { |
24 | ret withCenteredButtons(super.visualize(), "Scan", rThread scan); |
25 | } |
26 | |
27 | void scan enter { |
28 | new L<Entry> list; |
29 | new Flag interrupted; |
30 | temp AutoCloseable action = dm_currentAction("Scanning chat", rRaiseFlag(interrupted)); |
31 | F0<GazelleEvalContext> contextMaker = new GazelleContextCache_v2().fill(); |
32 | L<GazelleLine> lines = dm_discord_allLines(); |
33 | int i = 0; |
34 | for (GazelleLine line : reversed(lines)) { |
35 | ++i; |
36 | if (!licensed() || interrupted!) break; |
37 | Collection<GInterpretable> l = gazelle_preprocess(line.text, +contextMaker); |
38 | for (GInterpretable intp : l) |
39 | list.add(nu Entry(originalLine := line.text, msgID := line.msgID, interpretableText := intp.text, ruleID := intp.ruleID)); |
40 | call(action, 'setText, "Found " + n2(list, "interpretable") + ", scanned " + i + "/" + n2(lines, "line")); |
41 | } |
42 | setList(list); |
43 | } |
44 | } |
Began life as a copy of #1022180
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: | #1022191 |
Snippet name: | Interpretables Test v4 [shortened, OK] |
Eternal ID of this version: | #1022191/4 |
Text MD5: | 7183448be0b76fa87ae3f2b6158f737f |
Transpilation MD5: | f7b7bb600d11ba161cfc908afea59a9a |
Author: | stefan |
Category: | javax / gazelle |
Type: | JavaX source code (Dynamic Module) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2019-03-10 16:01:54 |
Source code size: | 1297 bytes / 44 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 326 / 429 |
Version history: | 3 change(s) |
Referenced in: | [show references] |