StringTools
MonotonicFactors
compute the (left-to-right) monotonic factorization of a string
Calling Sequence
Parameters
Description
Examples
MonotonicFactors( w )
w
-
Maple string
The MonotonicFactors( w ) command produces the monotonic factorization of the string w. It returns a list of strings whose catenation is the string w, such that each string in the list is maximal monotonic (either increasing or decreasing).
All of the StringTools package commands treat strings as (null-terminated) sequences of 8-bit (ASCII) characters. Thus, there is no support for multibyte character encodings, such as unicode encodings.
with⁡StringTools:
MonotonicFactors⁡abc
abc
MonotonicFactors⁡abcdedcccbabab
abcde,dc,ccba,ba,b
MonotonicFactors⁡ThueMorse⁡60
01,10,10,01,10,01,01,10,10,01,01,10,01,10,10,01,10,01,01,10,01,10,10,01,01,10,10,01,10,01
MonotonicFactors⁡Fibonacci⁡8
01,001,01,001,001,01,001,01,001,001,01,001,001
See Also
string
StringTools[IsMonotonic]
StringTools[LyndonFactors]
Download Help Document