-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add short and long utterances on token count plot #442
Conversation
showarrow=False, | ||
) | ||
|
||
# Add thresholds for short and long utterances. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only this code is new, the one above was just moved in an else
so it is only computed when data is available.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Beautiful! 👌 And useful, I think. 👍
for threshold, edge, pretty_name, xanchor in zip( | ||
[ | ||
syntax_options.short_utterance_max_word + 0.5, | ||
syntax_options.long_utterance_min_word - 0.5, | ||
], | ||
[0, max_x + 1], | ||
["Short utterances", "Long utterances"], | ||
["right", "left"], | ||
): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
By the way, that's a detail, but you could avoid the zip()
by defining the lists/tuples in the other "direction", like
for threshold, edge, pretty_name, xanchor in zip( | |
[ | |
syntax_options.short_utterance_max_word + 0.5, | |
syntax_options.long_utterance_min_word - 0.5, | |
], | |
[0, max_x + 1], | |
["Short utterances", "Long utterances"], | |
["right", "left"], | |
): | |
for threshold, edge, pretty_name, xanchor in ( | |
(syntax_options.short_utterance_max_word + 0.5, 0, "Short utterances", "right"), | |
(syntax_options.long_utterance_min_word - 0.5, max_x + 1, "Long utterances", "left"), | |
): |
Resolve #94
Description:
Self-explanatory :)
Checklist:
You should check all boxes before the PR is ready. If a box does not apply, check it to acknowledge it.
ran
pre-commit run --all-files
at the end.our users.
README
files and our wiki for any big design decisions, if relevant.