예제 #1
0
 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")
예제 #2
0
 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")
예제 #3
0
    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")
예제 #4
0
 def interpret(self, match):
     actor = IsPerson() + StarsIn(match.tvshow)
     name = LabelOf(actor)
     return name, "enum"
예제 #5
0
 def interpret(self, match):
     chairman = IsPerson() + ChairmanOf(match.team)
     chairman_name = NameOf(chairman)
     return chairman_name, "literal"
예제 #6
0
 def interpret(self, match):
     memberStation = IsCareerStation() + IsTeamOf(match.team) + HasYear(
         match.year)
     member = IsPerson() + IsCareerStationOf(memberStation)
     member_name = NameOf(member)
     return member_name, "enum"
예제 #7
0
 def interpret(self, match):
     manager = IsPerson() + ManagerOf(match.team)
     manager_name = NameOf(manager)
     return manager_name, "literal"
예제 #8
0
 def interpret(self, match):
     actor = NameOf(IsPerson() + StarsIn(match.movie))
     print(actor)
     return actor, "enum"
예제 #9
0
 def interpret(self, match):
     name = match.words.tokens
     pronouns.his = name
     pronouns.her = name
     return IsPerson() + HasKeyword(name)
예제 #10
0
 def interpret(self, match):
     name = match.words.tokens
     exp = IsPerson()
     exp.tables = ["directors"]
     return exp + HasKeyword(name)
예제 #11
0
 def interpret(self, match):
     _movie, i, j = match.movie
     director = IsPerson() + DirectorOf(_movie)
     director_name = NameOf(director)
     return director_name, ReturnValue(i, j)
예제 #12
0
 def interpret(self, match):
     director = IsPerson() + DirectorOf(match.movie)
     director_name = NameOf(director)
     return director_name, "literal"
예제 #13
0
 def interpret(self, match):
     _book, i, j = match.book
     author = NameOf(IsPerson() + AuthorOf(_book))
     return author, ReturnValue(i, j)
예제 #14
0
 def interpret(self, match):
     name = match.words.tokens
     return IsPerson() + HasKeyword(name)
예제 #15
0
 def interpret(self, match):
     _movie, i, j = match.movie
     actor = NameOf(IsPerson() + StarsIn(_movie))
     return actor, ReturnValue(i, j)
예제 #16
0
 def interpret(self, match):
     author = NameOf(IsPerson() + AuthorOf(match.book))
     return author, "literal"
예제 #17
0
 def interpret(self, match):
     tv_show, i, j = match.tvshow
     actor = IsPerson() + StarsIn(tv_show)
     name = LabelOf(actor)
     return name, ReturnValue(i, j)