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

23
LINES

< > BotCompany Repo | #1021121 // Text To Language CRUD

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

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

!7

concept Entry {
  S word;
  S languages; // comma-separated
}

cmodule WordToLanguageCRUD > DynCRUD<Entry> {
  start {
    dbIndexing(Entry, 'word);
  }
  
  // API
  
  void addEntry(S word, S language) {
    Entry e = uniq_sync Entry(+word);
    cset(e, languages := addToCommaCISet(e.languages, language));
  }
  
  S languageForText(S text) {
    ret getString languages(conceptWhereIC Entry(word := text));
  }
}

Author comment

Began life as a copy of #1021109

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: #1021121
Snippet name: Text To Language CRUD
Eternal ID of this version: #1021121/6
Text MD5: 2b1e03b2df8e8fdbcb513a790e97a6d6
Transpilation MD5: 8b942deb4ffaa6338b96ca021394f35e
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 23:14:05
Source code size: 443 bytes / 23 lines
Pitched / IR pitched: No / No
Views / Downloads: 275 / 850
Version history: 5 change(s)
Referenced in: [show references]