Ticket #9958: trac_9958-suffix_trees-variations-sl.patch

File trac_9958-suffix_trees-variations-sl.patch, 1.1 KB (added by slabbe, 9 years ago)

Fix machine dependant doctest in suffix tree

  • sage/combinat/words/suffix_trees.py

    # HG changeset patch
    # User Sebastien Labbe <slabqc at gmail.com>
    # Date 1323796890 18000
    # Node ID c6afb6cb55ffb32c84558655c0ec0f75c1dec2b9
    # Parent  85630e734a59208bad4886d8a74830d9247f1183
    #9958: suffix trees - fixing a machine dependant doctest
    
    diff --git a/sage/combinat/words/suffix_trees.py b/sage/combinat/words/suffix_trees.py
    a b class ImplicitSuffixTree(SageObject): 
    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)