@@ -51,16 +51,17 @@ def get_sentence_analysis(disambiguated_sentence: List[DisambiguatedWord], token
5151# sourcery skip: switch
5252# get an analysis based on the selection criteria
5353# top means take first
54+ # tok_match takes the first analysis that matches diac, otherwise takes first
5455# match means take the first analysis that matches the selection criteria.
5556# selection criteria: {'criteria1': 'value1', 'criteria2': 'value2'...}
5657# return None if criteria not fulfilled.
5758# TODO: check if selection criteria contains valid keys
5859if selection == 'top' :
5960return [get_first_analysis (disambig_word )for disambig_word in disambiguated_sentence ]
60- elif selection == 'match' :
61- return [get_analysis_by_criteria (disambig_word ,selection_criteria )for disambig_word in disambiguated_sentence ]
6261elif selection == 'tok_match' :
6362return [get_tok_match_analysis (disambig_word ,token )for disambig_word ,token in zip (disambiguated_sentence ,token_line )]
63+ elif selection == 'match' :
64+ return [get_analysis_by_criteria (disambig_word ,selection_criteria )for disambig_word in disambiguated_sentence ]
6465else :
6566raise ValueError (f"the selection{ selection } is not valid!" )
6667