You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

12345678910111213141516171819202122
  1. from .segments import Segment
  2. from .types import SegmentType
  3. class SegmentGroup(Segment):
  4. value_type: SegmentType = SegmentType.GROUP
  5. value: list[Segment] = None # type: ignore
  6. @property
  7. def text(self):
  8. return "".join([segment.text for segment in self.value])
  9. @property
  10. def log(self):
  11. return "".join([segment.log for segment in self.value])
  12. @property
  13. def markdown(self):
  14. return "".join([segment.markdown for segment in self.value])
  15. def to_object(self):
  16. return [segment.to_object() for segment in self.value]