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)

scope ai_antiWordCategoriesWithElements.

static TimedCache<Map<S, Map<S, Set<S>>>> #cache = new TimedCache(f ciMap, 10.0); // language -> category -> words

static Map<S, Set<S>> ai_antiWordCategoriesWithElements() {
  Map<S, Map<S, Set<S>>> languages = cache!;
  Map<S, Set<S>> map = languages.get(ai_language());
  if (map == null)
    languages.put(ai_language(), map = make());
  ret map;
}

static Map<S, Set<S>> #make() {
  final Map<S, Set<S>> wordCategories = ciMap();
  for (S cat : mL("All " + ai_language() + " word categories"))
    putIfValueNempty(wordCategories, cat, combinedMechSetsCI(ai_antiMechListNamesForAngleBracketCategory(cat)));
  ret wordCategories;
}

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: 357 / 372
Version history: 2 change(s)
Referenced in: #1006654 - Standard functions list 2 (LIVE, continuation of #761)