| |
- all_names()
- A function that returns all named available for the game
- check_answer(game_data, answer)
- Returns whether the answer is the name in the game data or not
and updates the score dictionnary
- clean_sentences(tagged_sentences)
- A function that transforms tagged sentences into clean sentences
Input :
- tagged_sentences : a list of tuples
Output :
- Returns a list of strings
- game(name='', score=None)
- A function that runs a game
Input :
- name : current name to find
- names : list of all available names for the game
- score : dictionnary of the state of the score
Output :
- Returns a dict containing :
- the name chosen for the game
- a list of tagged sentences to use
- a list of used tagged sentences
- a dictionnary representing the score
- generate_sentences(sentences, article_file)
- A function that transform third person tagged sentences into
first person tagged sentences
Input :
- sentences : a list of tagged sentences
- article_file : a file where all the steps of transformation are registered
Output :
- Returns a list of tagged sentences.
- initial_sentences(article, article_file)
- A function that get the summary from a wikipedia page and tags it
Input :
- article : the name of the wikipedia page
- article_file : a file where all the steps of transformation are registered
Output :
- Returns a list of tagged sentences.
- new_name(names, old='')
- A function that randomly choose a new name to guess for the game
avoiding the current one.
Input :
- names : the list of names we want too choose from
- old : the current name
Output :
- Returns a string.
- next_stce(game_data, minus='-100')
- This function gives one more sentence to be showed to the player
Input:
- game_data : a dictionnary summarizing the state of the game
- minus : a string representing the number of point to remove
from the player's score
Output:
- a tuple containing:
- a boolean (whether there is sentences left or not)
- the updated game data
- replay(game_data, won)
- Update the score and launch a new game
Input:
- game_data : a dictionnary representing the state of the game
Output:
- a dictionnary representing the state of the game
- spaces_parsing(text)
- A function that regularize spaces
Arguments:
text {string} -- text where we need to clean spaces
Returns:
[string] -- Returns modified text
- update_score(score, operation, total=False)
- A function that updates the score and prevent it to go below 0.
|