@@ -5949,7 +5949,6 @@ def sturmian_desubstitute_as_possible(self):
5949
5949
desubstitued_word = desubstitued_word + w_running ** (current_run_length - min_run )
5950
5950
return desubstitued_word .sturmian_desubstitute_as_possible ()
5951
5951
5952
-
5953
5952
def is_sturmian_factor (self ):
5954
5953
r"""
5955
5954
Tell whether ``self`` is a factor of a Sturmian word.
@@ -6010,7 +6009,6 @@ def is_sturmian_factor(self):
6010
6009
"""
6011
6010
return self .sturmian_desubstitute_as_possible ().is_empty ()
6012
6011
6013
-
6014
6012
def is_tangent (self ):
6015
6013
r"""
6016
6014
Tell whether ``self`` is a tangent word.
@@ -6080,7 +6078,6 @@ def is_tangent(self):
6080
6078
mini = min (mini , height )
6081
6079
return (maxi - mini <= 2 )
6082
6080
6083
-
6084
6081
# TODO.
6085
6082
# 1. Those three swap functions should use the cmp of python.
6086
6083
# 2. The actual code should then be copied as is in the Word_over_Alphabet
@@ -7175,7 +7172,6 @@ def minimal_conjugate(self):
7175
7172
if end >= p .length ():
7176
7173
return factor ** q
7177
7174
7178
- #######################################################################
7179
7175
7180
7176
class CallableFromListOfWords (tuple ):
7181
7177
r"""
@@ -7222,6 +7218,7 @@ def __call__(self, i):
7222
7218
j -= c .length ()
7223
7219
raise IndexError ("index (=%s) out of range" % i )
7224
7220
7221
+
7225
7222
class Factorization (list ):
7226
7223
r"""
7227
7224
A list subclass having a nicer representation for factorization of words.
@@ -7245,6 +7242,7 @@ def __repr__(self):
7245
7242
"""
7246
7243
return '(%s)' % ', ' .join (w .string_rep () for w in self )
7247
7244
7245
+
7248
7246
#######################################################################
7249
7247
7250
7248
def evaluation_dict (w ):
@@ -7270,13 +7268,13 @@ def evaluation_dict(w):
7270
7268
7271
7269
sage: evaluation_dict('1213121') # keys appear in random order
7272
7270
{'1': 4, '2': 2, '3': 1}
7273
-
7274
7271
"""
7275
7272
d = defaultdict (int )
7276
7273
for a in w :
7277
7274
d [a ] += 1
7278
7275
return dict (d )
7279
7276
7277
+
7280
7278
def word_to_ordered_set_partition (w ):
7281
7279
r"""
7282
7280
Return the ordered set partition corresponding to a finite
0 commit comments