def get_best_match_gender(self, pq): info_words = self.get_info_word_list(pq) key_bundle = find_best_match(info_words=info_words, key_map=GENDER_GUESS_KEYWORDS_MAP) # if it does not match any word return female if not key_bundle.get("match_count") > 0: return GENDER_FEMALE return key_bundle.get("name")
def get_best_match_type(self, pq): info_words = self.get_info_word_list(pq) key_bundle = find_best_match(info_words=info_words, key_map=TYPE_GUESS_KEYWORDS_MAP) return key_bundle.get("name")