IntegerTextFromWordsT(IEnumerableIEnumerableT, Boolean, Int32, Boolean, IComparerT) Method |
Generates an integer text from arbitrary elements. Each list in lists is treated as separate word. Each element is such a list is treated as character. The algorithm determines the lexicographical order of all elements in all lists
and then maps each unique element to an integer value, with increasing values in the lexicographical order of the elements. A unique mapping is even possible, if the elements are not sortable (i.e. if they not implement IComparable).
Namespace: Altaxo.Collections.TextAssembly: AltaxoCore (in AltaxoCore.dll) Version: 4.8.3179.0 (4.8.3179.0)
Syntax public static IntegerText FromWords<T>(
IEnumerable<IEnumerable<T>> lists,
bool withSeparators,
int padding,
bool useSortedMapping,
IComparer<T>? customSortingComparer
)
Parameters
- lists IEnumerableIEnumerableT
- The list of individual words.
- withSeparators Boolean
- If set to true, the converted text will contain the concenated 'words', separated by special separator elements. If set to false, the converted text will contain the concenated 'words' without separator elements.
- padding Int32
- Number of additional elements reserved in the allocated Text array. This is neccessary for some algorithms. The additional elements will contain zero values.
- useSortedMapping Boolean
- If this parameter is true, a sorted mapping of the elements T to integers will be used. The type T then has to implement IComparable. If this parameter is false, a unsorted HashSetT will be used to make a unique mapping of the elements to integers.
- customSortingComparer IComparerT
- If useSortedMapping is true, you can here provide a custom comparer for the elements of type T. Otherwise, if you want to use the default comparer, leave this parameter null.
Type Parameters
- T
- Type of the list elements.
Return Value
IntegerTextThe integer text data, which holds the text converted to an integer alphabet.
See Also