def __init__(self, tail, head=None):
'''
@param tail: the L{Tag} object to add to the first part (head)
@param head: the (eventually absent) L{MultiTag} to be extended
@returns: a new L{MultiTag} object
'''
if not head:
Tag.__init__(self, tail.string, tail.stem, tail.rating,
tail.proper, tail.terminal)
self.size = 1
self.subratings = [self.rating]
else:
self.string = ' '.join([head.string, tail.string])
self.stem = ' '.join([head.stem, tail.stem])
self.size = head.size + 1
self.proper = (head.proper and tail.proper)
self.terminal = tail.terminal
self.subratings = head.subratings + [tail.rating]
self.rating = self.combined_rating()
评论列表
文章目录