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

18
LINES

< > BotCompany Repo | #1017754 // ai_antiMechListNamesForAngleBracketCategory - non-examples

JavaX fragment (include)

1  
scope ai_antiMechListNamesForAngleBracketCategory.
2  
3  
// TODO: clean on language change
4  
static TimedCache<Map<S, Set<S>>> #cache = TimedCache(5.0);
5  
6  
static Set<S> ai_antiMechListNamesForAngleBracketCategory(S s) {
7  
  if (!isAngleBracketed(s)) null;
8  
  Map<S, Set<S>> map = cache.get(f newHashMap);
9  
  s = dropTrailingNumberFromAngleBracketCategory(s);
10  
  if (map.containsKey(s)) ret map.get(s);
11  
  // Derive from the category name - use LinkedHashSet to keep first
12  
  Set<S> set = litorderedset(mechLanguagePrefix() + "Not " + plural_mech(replace(deAngleBracket(s), "_", " ")));
13  
  //set.addAll(mechMultiMapCI(mechLanguagePrefix() + "Word category => List").get(s));
14  
  map.put(s, set);
15  
  ret set;
16  
}
17  
18  
end scope

Author comment

Began life as a copy of #1017299

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: #1017754
Snippet name: ai_antiMechListNamesForAngleBracketCategory - non-examples
Eternal ID of this version: #1017754/1
Text MD5: 93f705d33b269e354bd6bd38c9fd49a2
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:22:30
Source code size: 717 bytes / 18 lines
Pitched / IR pitched: No / No
Views / Downloads: 324 / 348
Referenced in: [show references]