<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def filter_segs(self, segs):
 """Given list of strings, return only those which are valid segments. Args: segs (list):
 list of unicode values Returns: list: values in `segs` that are valid segments (according to the definititions of bases and diacritics/modifiers known to the object """

        def whole_seg(seg):
            m = self.seg_regex.match(seg)
            if m and m.group(0) == seg:
                return True
            else:
                return False
        return list(filter(whole_seg, segs))