@classmethod
    def readFromFile(cls, io):
        name = io.readWord()
        empty,firstVal= io.readWord().split('(')
        if not empty == '':
            raise ValueError("Cannot have chars preceding '(' in the same word on line %d"%io.line)
        self.add(firstVal)
        endSeen = False
        while not endSeen:
            val = io.readWord()
            try:
                lastVal, leftovers = val.split(')')
            except ValueError:
                self.add(val)
            else:
                endSeen = True
                if lastVal: #last char is )
                    self.add(lastVal)
                if leftovers:
                    raise ValueError("Was expecting a ')' by itself or at the end of a word on line %d"%io.line)
        return cls(name, featureValues)
dataset/ETHPy150Open uci-cbcl/tree-hmm/gmtkParam/__init__.py/FeatureDefinition.readFromFile/original