def interpret(self, match): movie = IsMovie() + HasActor(match.actor) movie_name = NameOf(movie) name_dir = ''.join(match.actor.nodes[0][1][1].split('"')[:-1]) names = name_dir.split() if u"recent" in [k.lemma for k in match.words]: movie_name.head = "a.name,a.surname,a.title" if len(names) == 1: movie_name.nodes = [ u' name like "' + names + '" and b.year>YEAR(curdate())-2' ] else: movie_name.nodes = [ u' name like "' + u" ".join(names[:-1]) + u'" and surname like "' + names[-1] + '" and b.year>YEAR(curdate())-2' ] movie_name.head = u"a.title" movie_name.tables = [ "actors as a left join movies as b on(a.movie_id=b.id) ", "actresses as a left join movies as b on(a.movie_id=b.id) " ] #print("definition ",definition) else: movie_name.tables = ["actors", "actresses"] movie_name.head = "title,name,surname" if len(names) == 1: movie_name.nodes = [u' name like "' + names + '"'] else: movie_name.nodes = [ u' name like "' + u" ".join(names[:-1]) + u'" and surname like "' + names[-1] + '"' ] return movie_name, ("enum", "ActedOnQuestion")
def interpret(self, match): show = IsTvShow() + HasActor(match.actor) show_name = ShowNameOf(show) return show_name, "enum"
def interpret(self, match): movie = IsMovie() + HasActor(match.actor) movie_name = NameOf(movie) print(movie_name.__dict__) return movie_name, "enum"
def interpret(self, match): _actor, i, j = match.actor movie = IsMovie() + HasActor(_actor) movie_name = NameOf(movie) return movie_name, ReturnValue(i, j)
def interpret(self, match): movie = IsMovie() + HasActor(match.actor) movie_name = LabelOf(movie) return movie_name, "enum"
def interpret(self, match): _actor, i, j = match.actor show = IsTvShow() + HasActor(_actor) show_name = ShowNameOf(show) return show_name, ReturnValue(i, j)