一般化された接尾辞ツリーを構築したいと考えています。この実装にはhttp://www.daimi.au.dk/~mailund/suffix_tree.htmlを使用しています。私のコードは次のとおりです。
s1 = u'abcd'
x = 36
for i in range(x):
listing.append(s1)
stree = GeneralisedSuffixTree(listing)
x = 35 の値の場合、コードは正常に動作していますが、x = 36 以上の場合、次のエラーが発生します
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-36-e7b83eadb302> in <module>()
6 listing.append(s1)
7
----> 8 stree = GeneralisedSuffixTree(listing)
9
10 count = []
/home/darshan/anaconda/lib/python2.7/site-packages/suffix_tree.pyc in __init__(self, sequences)
113 self.sequences += [u'']
114
--> 115 SuffixTree.__init__(self,concatString)
116 self._annotateNodes()
117
/home/darshan/anaconda/lib/python2.7/site-packages/suffix_tree.pyc in __init__(self, s, t)
60 must not contain the special symbol $.'''
61 if t in s:
---> 62 raise "The suffix tree string must not contain terminal symbol!"
63 _suffix_tree.SuffixTree.__init__(self,s,t)
64
TypeError: exceptions must be old-style classes or derived from BaseException, not str
例外はこのファイルからのものですhttps://github.com/Yacoby/suffix-tree-unicode/blob/master/suffix_tree.py
値 x < 36 では機能するが、他の値では機能しない理由がわかりません。ここで何が起こっているのかを理解するのを手伝ってください。