Ticket #9958: 9958_combinat.patch

File 9958_combinat.patch, 1.9 KB (added by jdemeyer, 9 years ago)
  • sage/combinat/words/nfactor_enumerable_word.py

    # HG changeset patch
    # User Jeroen Demeyer <jdemeyer@cage.ugent.be>
    # Date 1325803200 -3600
    # Node ID 64f9a8bd26a3212b245e68ed57c4a66739b73eed
    # Parent  3592d79b17017008ca7c057eeff01065f86acf3a
    Fixes to combinat for Python-2.7
    
    diff --git a/sage/combinat/words/nfactor_enumerable_word.py b/sage/combinat/words/nfactor_enumerable_word.py
    a b  
    1313
    1414EXAMPLES:
    1515
    16 Enumeration of factors::
     16Enumeration of factors, the successive values returned by it.next()
     17can appear in a different order depending on hardware. Therefore we
     18mark the three first results of the test random. The important test
     19is that the iteration stops properly on the fourth call::
    1720
    1821    sage: w = Word([4,5,6])^7
    1922    sage: it = w.factor_iterator(4)
    20     sage: it.next()
     23    sage: it.next() # random
    2124    word: 6456
    22     sage: it.next()
     25    sage: it.next() # random
    2326    word: 5645
    24     sage: it.next()
     27    sage: it.next() # random
    2528    word: 4564
    2629    sage: it.next()
    2730    Traceback (most recent call last):
  • sage/combinat/words/suffix_trees.py

    diff --git a/sage/combinat/words/suffix_trees.py b/sage/combinat/words/suffix_trees.py
    a b  
    13201320            sage: from sage.combinat.words.suffix_trees import ImplicitSuffixTree, SuffixTrie
    13211321            sage: W = Words("ab")
    13221322            sage: t = ImplicitSuffixTree(W("aba"))
    1323             sage: t.trie_type_dict() == dict([[(0, W("a")), 4], [(0, W("b")), 3], [(3, W("a")), 2], [(4, W("b")), 5], [(5, W("a")), 1]])
    1324             True
     1323            sage: d = t.trie_type_dict()
     1324            sage: len(d)
     1325            5
     1326            sage: d                     # random
     1327            {(4, word: b): 5, (0, word: a): 4, (0, word: b): 3, (5, word: a): 1, (3, word: a): 2}
    13251328        """
    13261329        d = {}
    13271330        new_node = len(self._transition_function)