File size: 560 Bytes
a8b3f00
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
from .segments import Segment
from .types import SegmentType


class SegmentGroup(Segment):
    value_type: SegmentType = SegmentType.GROUP
    value: list[Segment]

    @property
    def text(self):
        return "".join([segment.text for segment in self.value])

    @property
    def log(self):
        return "".join([segment.log for segment in self.value])

    @property
    def markdown(self):
        return "".join([segment.markdown for segment in self.value])

    def to_object(self):
        return [segment.to_object() for segment in self.value]