adds number_of_n_syllable_words_all function #21
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This adds the
number_of_n_syllable_words_all
function todescriptive_statistics.py
.For a list of texts, it counts the frequency of all n-syllable words for all values of n that it finds.
At the moment it is already possible, but a bit cumbersome, to find the frequencies of all syllables that exist in a text.
Consider this example:
The very long word (apparently) has 13 syllables. But I don't necessarily know that it exists in my corpus. Currently I could find it by calling the
number_of_n_syllable_words
in a loop, and using a large enough number:But this is a bit inefficient.
With the new function this becomes much easier:
Prints:
This new function also allows the user to easily find the frequency of only certain n-syllable words, such as "frequency of all 3-syllable and 5-syllable words, but nothing else". Again, this is already possible with
number_of_n_syllable_words
but all texts need to be processed twice with this approach (due to requiring two function calls - one withn=(3,4)
and one withn=(5,6)
which is a bit slow.