Libraryless. Click here for Pure Java version (2941L/18K).
1 | static BigInt combinationsForPositionalParser(int positions, IF1<Int, L<Int>> skipsFromPosition, O... _) { |
2 | optPar bool debug; |
3 | Map<Int, BigInt> combinationsFromPosition = autoTreeMap(() -> bigint(1)); |
4 | for (int i = positions-1; i >= 0; i--) { |
5 | BigInt combinations = bigint(0); |
6 | fOr (int skip : skipsFromPosition.get(i)) |
7 | combinations = plus(combinations, combinationsFromPosition.get(i+skip)); |
8 | if (debug) |
9 | print("Combinations from " + i + ": " + combinations); |
10 | combinationsFromPosition.put(i, combinations); |
11 | } |
12 | ret combinationsFromPosition.get(0); |
13 | } |
download show line numbers debug dex old transpilations
Travelled to 7 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt, xrpafgyirdlv
No comments. add comment
Snippet ID: | #1028161 |
Snippet name: | combinationsForPositionalParser |
Eternal ID of this version: | #1028161/6 |
Text MD5: | 6af77d151b67dfbb42e5323cebdbef9e |
Transpilation MD5: | 1552390518c03ffd245ec2cb265c82cf |
Author: | stefan |
Category: | javax / stefan's os / nlp |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2020-05-23 18:51:17 |
Source code size: | 592 bytes / 13 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 253 / 344 |
Version history: | 5 change(s) |
Referenced in: | [show references] |