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

1  
!7
2  
3  
concept Entry {
4  
  S word;
5  
  S languages; // comma-separated
6  
}
7  
8  
cmodule WordToLanguageCRUD > DynCRUD<Entry> {
9  
  start {
10  
    dbIndexing(Entry, 'word);
11  
  }
12  
  
13  
  // API
14  
  
15  
  void addEntry(S word, S language) {
16  
    Entry e = uniq_sync Entry(+word);
17  
    cset(e, languages := addToCommaCISet(e.languages, language));
18  
  }
19  
  
20  
  S languageForText(S text) {
21  
    ret getString languages(conceptWhereIC Entry(word := text));
22  
  }
23  
}

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