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

20
LINES

< > BotCompany Repo | #1017360 // ai_wordCategoriesWithElements - for ai_language()

JavaX fragment (include)

scope ai_wordCategoriesWithElements.

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

static Map<S, Set<S>> ai_wordCategoriesWithElements() {
  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_mechListNamesForAngleBracketCategory(cat)));
  ret wordCategories;
}

end scope

Author comment

Began life as a copy of #1017343

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: #1017360
Snippet name: ai_wordCategoriesWithElements - for ai_language()
Eternal ID of this version: #1017360/7
Text MD5: 6abd1dfbb56280f1b0273d567bbe2a15
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:29:40
Source code size: 696 bytes / 20 lines
Pitched / IR pitched: No / No
Views / Downloads: 438 / 499
Version history: 6 change(s)
Referenced in: [show references]