Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

44
LINES

< > BotCompany Repo | #1022280 // Gazelle: Grouped Chat Lines

JavaX source code (Dynamic Module) [tags: use-pretranspiled] - run with: Stefan's OS

Uses 911K of libraries. Click here for Pure Java version (7085L/38K).

1  
!7
2  
3  
sclass Entry {
4  
  long msgID;
5  
  S originalLine;
6  
  S groupedText;
7  
8  
  sS _fieldOrder = "msgID originalLine groupedText";
9  
}
10  
11  
set flag DynModule.
12  
13  
cmodule GroupedChatLines > DynObjectTable<Entry> {
14  
  start {
15  
    addCountToName();
16  
    thread { scan(); }
17  
  }
18  
  
19  
  visualize {
20  
    ret withCenteredButtons(super.visualize(), "Scan", rThread scan);
21  
  }
22  
  
23  
  void scan enter {
24  
    new L<Entry> list;
25  
    new Flag interrupted;
26  
    temp AutoCloseable action = dm_currentAction("Scanning chat", rRaiseFlag(interrupted));
27  
    L<GazelleLine> lines = dm_discord_allLines();
28  
    int i = 0;
29  
    for (GazelleLine line : reversed(lines)) {
30  
      ++i;
31  
      if (!licensed() || interrupted!) break;
32  
      S input = trim(line.text);
33  
      if (empty(input)) continue;
34  
      S groupedText = gazelle_groupPhrases(input);
35  
      if (neq(groupedText, input))
36  
        list.add(nu Entry(
37  
          originalLine := input,
38  
          msgID := line.msgID,
39  
          +groupedText));
40  
      call(action, 'setText, "Found " + n2(list, "grouping") + ", scanned " + i + "/" + n2(lines, "line"));
41  
    }
42  
    setList(list);
43  
  }
44  
}

Author comment

Began life as a copy of #1022191

download  show line numbers  debug dex  old transpilations   

Travelled to 8 computer(s): bhatertpkbcr, cfunsshuasjs, mqqgnosmbjvj, onxytkatvevr, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1022280
Snippet name: Gazelle: Grouped Chat Lines
Eternal ID of this version: #1022280/8
Text MD5: 6a2b25cb96f6e30a46299317b4b23f38
Transpilation MD5: d7fad762038ae0c095dcdadab4a5589a
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-13 05:45:57
Source code size: 1131 bytes / 44 lines
Pitched / IR pitched: No / No
Views / Downloads: 250 / 461
Version history: 7 change(s)
Referenced in: [show references]