showCombination method
Combine words with commands.
Implementation
void showCombination(List<String> _wordList, Map<String, String> _commandM) {
bool savePB = _pB;
_pB = true;
String combStr = ('#debug test dawolang #typedef');
// To avoid unused:
combStr;
_pB = savePB;
print(' * * * COMBINATION-GALLERY * * * ');
//-----------------------------------
List<String> wordBunch = []; // all
List<String> unknownBunch = []; // only: : at the beginning
List<String> comBunch = []; // : as second letter
for (var y = 0; y < _wordList.length; y++) {
wordBunch.addAll(_wordList[y].split(' '));
}
print('wordBunch:: ');
print(wordBunch.length);
// print(wordBunch);
lt.linePrintList(wordBunch, 'wordBunch', 9);
for (var w = 0; w < wordBunch.length; w++) {
// Check for empty String or 1-length String
// print(wordBunch[w]);
if (wordBunch[w].substring(1, 2) == ':') {
// ?:S #:V C:W
comBunch.add(wordBunch[w]);
// #dartformat is funny here lol
comWordsCount++;
}
;
// TODO in 2 groups wordBunch, unknownBunch
if (wordBunch[w].substring(0, 1) == '?') {
// ?:S #:V C:W
unknownBunch.add(wordBunch[w]);
unknownWordsCount++;
}
} // ----- wordBunch.length
String comWordsCountS = comWordsCount.toString();
print('comBunch::Count: $comWordsCountS ');
print(comBunch.length);
// print(comBunch);
lt.linePrintList(comBunch, 'comBunch', 10);
String unknownWordsCountS = unknownWordsCount.toString();
print('unknownBunch:: Count: $unknownWordsCountS ');
print(unknownBunch.length);
// print(unknownBunch);
lt.linePrintList(unknownBunch, 'unKnownBunch', 7);
// TODO NullSafety
for (var x in _commandM.keys) {
int wordCount = 0;
// pad value left to 20:
String padS = '';
// hklTry .toString()
// padS = _commandM[x].padRight(20, '_');
// NO padS = _commandM[x].padRight(20, '_').toString();
// hklTry; .toString() in middle
padS = _commandM[x].toString().padRight(20, '_');
String findComS = lt.findAllStringsInList(x, comBunch);
_commandM[x] = padS + findComS;
// hklTry .toString() nullSafe OK
String vS = _commandM[x].toString(); // like: F: K:
print('$x $vS');
wordCount++;
// Just name it to avoid #unused::
wordCount;
}
print(' * * * COMBINATION-GALLERY done * * * \n');
}