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).

!7

sclass Entry {
  long msgID;
  S originalLine;
  S groupedText;

  sS _fieldOrder = "msgID originalLine groupedText";
}

set flag DynModule.

cmodule GroupedChatLines > DynObjectTable<Entry> {
  start {
    addCountToName();
    thread { scan(); }
  }
  
  visualize {
    ret withCenteredButtons(super.visualize(), "Scan", rThread scan);
  }
  
  void scan enter {
    new L<Entry> list;
    new Flag interrupted;
    temp AutoCloseable action = dm_currentAction("Scanning chat", rRaiseFlag(interrupted));
    L<GazelleLine> lines = dm_discord_allLines();
    int i = 0;
    for (GazelleLine line : reversed(lines)) {
      ++i;
      if (!licensed() || interrupted!) break;
      S input = trim(line.text);
      if (empty(input)) continue;
      S groupedText = gazelle_groupPhrases(input);
      if (neq(groupedText, input))
        list.add(nu Entry(
          originalLine := input,
          msgID := line.msgID,
          +groupedText));
      call(action, 'setText, "Found " + n2(list, "grouping") + ", scanned " + i + "/" + n2(lines, "line"));
    }
    setList(list);
  }
}

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: 242 / 451
Version history: 7 change(s)
Referenced in: [show references]