本文整理匯總了Python中movie.Movie.get_directors方法的典型用法代碼示例。如果您正苦於以下問題:Python Movie.get_directors方法的具體用法?Python Movie.get_directors怎麽用?Python Movie.get_directors使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類movie.Movie
的用法示例。
在下文中一共展示了Movie.get_directors方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: movie
# 需要導入模塊: from movie import Movie [as 別名]
# 或者: from movie.Movie import get_directors [as 別名]
def movie(sentence):
sentence = sentence.lower()
movie_list = []
m = Movie()
parental_rating(sentence, m)
genre(sentence, m)
directors(sentence, m)
stars(sentence, m)
p = m.get_parental_rating() == ''
g = m.get_genre() == []
d = m.get_directors() == []
s = m.get_stars() == []
for movie in allmovies:
parental_rating_pass = p
genre_pass = g
director_pass = d
stars_pass = s
if not parental_rating_pass:
parental_rating_pass = m.get_parental_rating() == movie[2]
if not genre_pass:
for m_genre in m.get_genre():
genre_pass = m_genre in movie[4].lower()
if not director_pass:
i = 1
if movie[6].lower() != '':
temp = movie[6].lower().split(', ')
for actor in temp:
director_pass = actor in m.get_directors()[i-1].lower()
if director_pass:
break;
while i < len(m.get_directors()):
temp1 = False
temp2 = False
for actor in temp:
temp1 = actor in m.get_directors()[i-1].lower()
if temp1:
break;
for actor in temp:
temp2 = actor in m.get_directors()[i+1].lower()
if temp2:
break;
if m.get_directors()[i].lower() == 'and':
director_pass = temp1 and temp2
elif m.get_directors()[i].lower() == 'or':
director_pass = temp1 or temp2
if director_pass and i + 2 < len(m.get_directors()) and m.get_directors()[i + 2].lower() == 'or':
break;
i += 2
if not stars_pass:
i = 1
if movie[8].lower() != '':
temp = movie[8].lower().split(', ')
for actor in temp:
stars_pass = actor in m.get_stars()[i-1].lower()
if stars_pass:
break;
while i < len(m.get_stars()):
temp1 = False
temp2 = False
for actor in temp:
temp1 = actor in m.get_stars()[i-1].lower()
if temp1:
break;
for actor in temp:
temp2 = actor in m.get_stars()[i+1].lower()
if temp2:
break;
if m.get_stars()[i].lower() == 'and':
stars_pass = temp1 and temp2
elif m.get_stars()[i].lower() == 'or':
stars_pass = temp1 or temp2
if stars_pass and i + 2 < len(m.get_stars()) and m.get_stars()[i + 2].lower() == 'or':
break;
i += 2
if parental_rating_pass and genre_pass and director_pass and stars_pass:
if p and g and d and s:
return check_product([], sentence, p, g, d, s)
movie_list.append(movie[1])
return check_product(movie_list, sentence, p, g, d, s)