def _lf_to_coord_funs(sem): """ Gets a list of (coordinate,function) pairs from a logical form. """ from jazzparser.formalisms.music_halfspan.semantics import \ list_lf_to_coordinates, list_lf_to_functions # Convert the LF to a list of coordinates coords, __ = zip(*list_lf_to_coordinates(sem)) # And to a list of functions funs, __ = zip(*list_lf_to_functions(sem)) # Put them together into (coord,fun) pairs return zip(coords, funs)
def _lf_to_coord_funs(sem): """ Gets a list of (coordinate,function) pairs from a logical form. """ from jazzparser.formalisms.music_halfspan.semantics import \ list_lf_to_coordinates, list_lf_to_functions # Convert the LF to a list of coordinates coords,__ = zip(*list_lf_to_coordinates(sem)) # And to a list of functions funs,__ = zip(*list_lf_to_functions(sem)) # Put them together into (coord,fun) pairs return zip(coords,funs)
def test_nested_coordination(self): for semantics,correct in self.nested_coordination: output,times = zip(*list_lf_to_coordinates(semantics.lf)) self.assertExpected(list(output), correct, semantics)
def test_develop(self): for semantics,correct in self.develop: output,times = zip(*list_lf_to_coordinates(semantics.lf)) self.assertExpected(list(output), correct, semantics)