def interpret(self, match): actor = IsPerson() movie_name = ''.join(match.movie.nodes[0][1][1].split('"')[:-1]) actor.nodes = [u' title like "%' + movie_name + '%"'] actor.tables = ["actors", "actresses"] actor.head = u"name,surname,title" return actor, ("enum", "ActorsOfQuestion")
def interpret(self, match): director_name = IsPerson() movie_name = ''.join(match.movie.nodes[0][1][1].split('"')[:-1]) director_name.nodes = [u' title like "%' + movie_name + '%"'] director_name.tables = [u"directors"] director_name.head = u"name,surname,title " #director = IsPerson() + DirectorOf(match.movie) #director_name = NameOf(director) director_name.tables = ["directors"] return director_name, ("literal", "DirectorOfQuestion")
def interpret(self, match): #print(dir(match), match.director, match.words) #movie = IsMovie() + DirectedBy(match.director) #movie_name = LabelOf(movie) #use only the name of the director name_dir = ''.join(match.director.nodes[0][1][1].split('"')[:-1]) names = name_dir.split() movie_name = IsPerson() 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] + '"' ] movie_name.tables = [u"directors"] movie_name.head = u"title" return movie_name, ("enum", "MoviesByDirectorQuestion")
def interpret(self, match): actor = IsPerson() + StarsIn(match.tvshow) name = LabelOf(actor) return name, "enum"
def interpret(self, match): chairman = IsPerson() + ChairmanOf(match.team) chairman_name = NameOf(chairman) return chairman_name, "literal"
def interpret(self, match): memberStation = IsCareerStation() + IsTeamOf(match.team) + HasYear( match.year) member = IsPerson() + IsCareerStationOf(memberStation) member_name = NameOf(member) return member_name, "enum"
def interpret(self, match): manager = IsPerson() + ManagerOf(match.team) manager_name = NameOf(manager) return manager_name, "literal"
def interpret(self, match): actor = NameOf(IsPerson() + StarsIn(match.movie)) print(actor) return actor, "enum"
def interpret(self, match): name = match.words.tokens pronouns.his = name pronouns.her = name return IsPerson() + HasKeyword(name)
def interpret(self, match): name = match.words.tokens exp = IsPerson() exp.tables = ["directors"] return exp + HasKeyword(name)
def interpret(self, match): _movie, i, j = match.movie director = IsPerson() + DirectorOf(_movie) director_name = NameOf(director) return director_name, ReturnValue(i, j)
def interpret(self, match): director = IsPerson() + DirectorOf(match.movie) director_name = NameOf(director) return director_name, "literal"
def interpret(self, match): _book, i, j = match.book author = NameOf(IsPerson() + AuthorOf(_book)) return author, ReturnValue(i, j)
def interpret(self, match): name = match.words.tokens return IsPerson() + HasKeyword(name)
def interpret(self, match): _movie, i, j = match.movie actor = NameOf(IsPerson() + StarsIn(_movie)) return actor, ReturnValue(i, j)
def interpret(self, match): author = NameOf(IsPerson() + AuthorOf(match.book)) return author, "literal"
def interpret(self, match): tv_show, i, j = match.tvshow actor = IsPerson() + StarsIn(tv_show) name = LabelOf(actor) return name, ReturnValue(i, j)