asrtoolkit/data_structures/segment.py
def validate(self):
    """
      Checks for common failure cases for if a line is valid or not
    """
    valid = self.speaker != "inter_segment_gap" and \
      self.text and \
      self.text != "ignore_time_segment_in_scoring" and \
      self.label in ["<o,f0,male>", "<o,f0,female>"]

    try:
      self.start = clean_float(self.start)
      self.stop = clean_float(self.stop)
    except Exception as exc:
      valid = False
      print(exc)

    if not valid:
      print("Skipping segment due to validation error: \n", " ".join(self.__dict__[_] for _ in self.__dict__))

    if "-" in self.audiofile:
      self.audiofile = self.audiofile.replace("-", "_")
      print("Please rename audio file to replace hyphens with underscores")

    return valid

      Checks for common failure cases for if a line is valid or not
    
Checks for common failure cases for if a line is valid or not
Checks for common failure cases for if a line is valid or not
def validate(self):
    valid = self.speaker != "inter_segment_gap" and \
      self.text and \
      self.text != "ignore_time_segment_in_scoring" and \
      self.label in ["<o,f0,male>", "<o,f0,female>"]
    try:
      self.start = clean_float(self.start)
      self.stop = clean_float(self.stop)
    except Exception as exc:
      valid = False
      print(exc)
    if not valid:
      print("Skipping segment due to validation error: \n", " ".join(self.__dict__[_] for _ in self.__dict__))
    if "-" in self.audiofile:
      self.audiofile = self.audiofile.replace("-", "_")
      print("Please rename audio file to replace hyphens with underscores")
    return valid
def validate ( self ) : valid = self . speaker != "inter_segment_gap" and self . text and self . text != "ignore_time_segment_in_scoring" and self . label in [ "<o,f0,male>" , "<o,f0,female>" ] try : self . start = clean_float ( self . start ) self . stop = clean_float ( self . stop ) except Exception as exc : valid = False print ( exc ) if not valid : print ( "Skipping segment due to validation error: \n" , " " . join ( self . __dict__ [ _ ] for _ in self . __dict__ ) ) if "-" in self . audiofile : self . audiofile = self . audiofile . replace ( "-" , "_" ) print ( "Please rename audio file to replace hyphens with underscores" ) return valid
Checks for common failure cases for if a line is valid or not
Checks for common failure cases for if a line is valid or not
"""
      Checks for common failure cases for if a line is valid or not
    """
self