idsortingalgorithm¶
This module contains the following classes:
IDSortingAlgorithm, enumerating and implementing the available algorithms to sort a list of XMLidattributes.
Warning
This module is likely to be refactored in a future version
-
class
aeneas.idsortingalgorithm.IDSortingAlgorithm(algorithm, rconf=None, logger=None)[source]¶ Enumeration of the available algorithms to sort a list of XML
idattributes.Parameters: - algorithm (
IDSortingAlgorithm) – the id sorting algorithm to be used - rconf (
RuntimeConfiguration) – a runtime configuration - logger (
Logger) – the logger object
Raises: ValueError: if the value of
algorithmis not allowed-
ALLOWED_VALUES= ['lexicographic', 'numeric', 'unsorted']¶ List of all the allowed values
-
LEXICOGRAPHIC= 'lexicographic'¶ Lexicographic sorting (e.g.,
f020beforef10beforef2)
-
NUMERIC= 'numeric'¶ Numeric sorting, ignoring any non-digit characters or leading zeroes (e.g.,
f2(=2) beforef10(=10) beforef020(=20))
-
UNSORTED= 'unsorted'¶ Do not sort and return the list of identifiers, in their original order (e.g.,
f2beforef020beforef10, assuming this was their order in the XML DOM)
- algorithm (