def groupIntoChoices(splitsOnWord, wordWidth: int, origin: OneOfTransaction):
def cmpWordIndex(a, b):<EOL><INDENT>return a.startOfPart // wordWidth < b.startOfPart // wordWidth<EOL><DEDENT>actual = None<EOL>itCnt = len(splitsOnWord)<EOL>for i, item in iterSort(splitsOnWord, cmpWordIndex):<EOL><INDENT>_actualW = item.startOfPart // wordWidth<EOL>if actual is None:<EOL><INDENT>actual = ChoicesOfFrameParts(item.startOfPart, origin)<EOL>actual.extend(<EOL>ChoiceOfFrameParts(actual,<EOL>origin.possibleTransactions[_i])<EOL>for _i in range(itCnt))<EOL>actualW = _actualW<EOL><DEDENT>elif _actualW > actualW:<EOL><INDENT>actual.resolveEnd()<EOL>yield actual<EOL>actual = ChoicesOfFrameParts(item.startOfPart, origin)<EOL>actual.extend(<EOL>ChoiceOfFrameParts(actual,<EOL>origin.possibleTransactions[_i])<EOL>for _i in range(itCnt))<EOL>actualW = _actualW<EOL><DEDENT>actual[i].append(item)<EOL><DEDENT>if actual is not None:<EOL><INDENT>actual.setIsLast(True)<EOL>actual.resolveEnd()<EOL>yield actual<EOL><DEDENT>
:param splitsOnWord: list of lists of parts (fields splited on word
    boundaries)
:return: generators of ChoicesOfFrameParts for each word
    which are not crossing word boundaries