Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit2f85559

Browse files
documented the get_sentence_analysis function
1 parent74c23f2 commit2f85559

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

‎src/parse_disambiguation/disambiguation_analysis.py‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -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
5859
ifselection=='top':
5960
return [get_first_analysis(disambig_word)fordisambig_wordindisambiguated_sentence]
60-
elifselection=='match':
61-
return [get_analysis_by_criteria(disambig_word,selection_criteria)fordisambig_wordindisambiguated_sentence]
6261
elifselection=='tok_match':
6362
return [get_tok_match_analysis(disambig_word,token)fordisambig_word,tokeninzip(disambiguated_sentence,token_line)]
63+
elifselection=='match':
64+
return [get_analysis_by_criteria(disambig_word,selection_criteria)fordisambig_wordindisambiguated_sentence]
6465
else:
6566
raiseValueError(f"the selection{selection} is not valid!")
6667

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp