<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_string(self, word):
 """Return a string like the input but containing only legal IPA segments Args: word (unicode):
 input string to be filtered Returns: unicode: string identical to `word` but with invalid IPA segments absent """

        segs = [m.group(0) for m in self.seg_regex.finditer(word)]
        return ''.join(segs)