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

33
LINES

< > BotCompany Repo | #1021109 // Actual Words CRUD

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

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

!7

concept Entry {
  S word;
  S isWord; // 'yes, 'no, other
  S comment;
}

cmodule ActualWords > DynCRUD<Entry> {
  start {
    dbIndexing(Entry, 'word);
  }
  
  // API
  
  void addWordsWithComment(Iterable<S> words, S comment) {
    for (S word : words) {
      Entry e = uniq_sync Entry(+word, isWord := 'yes);
      cset(e, comment := joinNemptiesWithComma(e.comment, comment));
    }
  }
  
  S randomWord() {
    for ping (Entry e : shuffledIterator(concepts()))
      if (isYes(e.isWord))
        ret e.word;
    null;
  }
  
  LS actualWords() {
    ret collect word(filter(concepts(), func(Entry e) -> bool { isYes(e.isWord) }));
  }
}

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: #1021109
Snippet name: Actual Words CRUD
Eternal ID of this version: #1021109/8
Text MD5: b8f5f653d6cd80c0fd95080502bd9922
Transpilation MD5: c9c602cbb60eeb197d4e4684e6d7f02d
Author: stefan
Category: javax
Type: JavaX source code (Dynamic Module)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-01-23 21:02:38
Source code size: 680 bytes / 33 lines
Pitched / IR pitched: No / No
Views / Downloads: 312 / 1324
Version history: 7 change(s)
Referenced in: [show references]