UI utilities

Functions

save_suggestions

def save_suggestions(
   filename: str,
   accepted_suggestion_fetcher: Callable,
   source_terms: List[str],
   ) -> None:

Fetch the accepted suggestions and store them in a CSV file

ParameterTypeDescription
filenamestrThe filename to use to store the CSV file
accepted_suggestion_fetcherCallableA function to fetch the accepted suggestions to store
source_termsList[str]A list of source terms to match the accepted suggestions

choose_result

choose_result(
   source_term_index: int,
   choice: ConceptSuggestion,
   suggestion_fetcher: Callable[[int], SuggestionRecord],
   accepted_updater: Callable[[int, AcceptedSuggestion], None],
   ) -> None:

Choose a concept suggestion and update the accepted suggestions

ParameterTypeDescription
source_term_indexintThe index of the results to update
choice_indexintThe index of the choice in a suggestion to choose
suggestion_fetcherCallable[[int], SuggestionRecord]A function that fetches a SuggestionRecord at an index
accepted_updaterCallable[[int, AcceptedSuggestion], None]A function that takes an index and an AcceptedSuggestion