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

20
LINES

< > BotCompany Repo | #1017757 // ai_antiWordCategoriesWithElements - for ai_language()

JavaX fragment (include)

1  
scope ai_antiWordCategoriesWithElements.
2  
3  
static TimedCache<Map<S, Map<S, Set<S>>>> #cache = new TimedCache(f ciMap, 10.0); // language -> category -> words
4  
5  
static Map<S, Set<S>> ai_antiWordCategoriesWithElements() {
6  
  Map<S, Map<S, Set<S>>> languages = cache!;
7  
  Map<S, Set<S>> map = languages.get(ai_language());
8  
  if (map == null)
9  
    languages.put(ai_language(), map = make());
10  
  ret map;
11  
}
12  
13  
static Map<S, Set<S>> #make() {
14  
  final Map<S, Set<S>> wordCategories = ciMap();
15  
  for (S cat : mL("All " + ai_language() + " word categories"))
16  
    putIfValueNempty(wordCategories, cat, combinedMechSetsCI(ai_antiMechListNamesForAngleBracketCategory(cat)));
17  
  ret wordCategories;
18  
}
19  
20  
end scope

Author comment

Began life as a copy of #1017360

download  show line numbers  debug dex  old transpilations   

Travelled to 14 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, irmadwmeruwu, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1017757
Snippet name: ai_antiWordCategoriesWithElements - for ai_language()
Eternal ID of this version: #1017757/3
Text MD5: 11eed418184b8f541d28bedf4c647262
Author: stefan
Category: javax / a.i.
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-08-08 14:31:25
Source code size: 708 bytes / 20 lines
Pitched / IR pitched: No / No
Views / Downloads: 293 / 311
Version history: 2 change(s)
Referenced in: [show references]