1 | static TimedCache<Comparator<S>> ai_smallerCategoryComparator_cache = new TimedCache(10.0); |
2 | |
3 | static Comparator<S> ai_smallerCategoryComparator() { |
4 | ret ai_smallerCategoryComparator_cache.get(f ai_smallerCategoryComparator_uncached); |
5 | } |
6 | |
7 | static Comparator<S> ai_smallerCategoryComparator_uncached() { |
8 | final Set<Pair<S>> set = new HashSet(pairsToLower(ai_texts_unquoteBoth("is a smaller category than"))); |
9 | ret new Comparator<S>() { |
10 | public int compare(S a, S b) { |
11 | a = lower(a); |
12 | b = lower(b); |
13 | if (set.contains(pair(a, b))) ret -1; |
14 | if (set.contains(pair(b, a))) ret 1; |
15 | ret 0; |
16 | } |
17 | }; |
18 | } |
download show line numbers debug dex old transpilations
Travelled to 13 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt
No comments. add comment
Snippet ID: | #1012606 |
Snippet name: | ai_smallerCategoryComparator - smallest categories first |
Eternal ID of this version: | #1012606/5 |
Text MD5: | 7d54816c7ef88422c6f4d2a801f646b0 |
Author: | stefan |
Category: | javax / a.i. |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2017-12-07 17:00:23 |
Source code size: | 638 bytes / 18 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 437 / 484 |
Version history: | 4 change(s) |
Referenced in: | [show references] |