Hi Franco, Sebastien and others,

I'm correcting the patch about Interval Exchange Transformations (iet)
which uses a lot sage.iet.words.* (alphabet, words and morphisms). Just
some remarks about this nice library.

1) alphabet does not have a union procedure but... Alphabet heritates
from CombinatorialClass which implements a union procedure. It
crashes on some methods

{{{
sage: A1 = Alphabet("ab")
sage: A2 = Alphabet("cd")
sage: B = A1.union(A2)
sage: for letter in B: print letter,
....:
a b c d
sage: B.list()
['a', 'b', 'c', 'd']
sage: B.rank('c')
...
IndexError: letter not in alphabet: 'c'
sage: B.unrank(2)
...
IndexError: list index out of range
}}}

I propose to create a class UnionAlphabet which
heritates from UnionCombinatorialClass and Alphabet.
Do you agree ?


2) The _str_ method of words is pretty bad in a lot
of situations. Especially in my case where the labels
of my intervals are words (but there is also the example
of the Rauzy graph). Do you have any idea for this ?
I propose to build a _str_ method of any words
inside Words. I imagine something that looks like this

{{{
sage: W1 = Words(alphabet="abc",  str="standard")
sage:  print str(W2("abbaca"))
word: abbaca
sage: W2 = Words(alphabet="abc", str="minimalist")
sage: print str(W2("abbaca"))
abbaca
sage: W3 = Words(alphabet="abc", str="sequence")
sage: print str(W3("abbaca"))
a, b, b, a, c, a
}}}

The latter is especially nice when your alphabet looks like
   A = {'ab', 'ac', 'be'}

What do you think ?

Cheers,
Vincent

--

You received this message because you are subscribed to the Google Groups 
"sage-combinat-devel" group.
To post to this group, send email to sage-combinat-de...@googlegroups.com.
To unsubscribe from this group, send email to 
sage-combinat-devel+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sage-combinat-devel?hl=en.


Reply via email to