Skip to content

Conversation

@wannaphong
Copy link
Member

Calculates the counts of n-grams in the list words for the specified range.

>>> from pythainlp.lm import calculate_ngram_counts
>>> a=["1","2","3","4"]
>>> calculate_ngram_counts(a)
{('1', '2'): 1, ('2', '3'): 1, ('3', '4'): 1, ('1', '2', '3'): 1, ('2', '3', '4'): 1, ('1', '2', '3', '4'): 1}
>>> 

@pep8speaks
Copy link

pep8speaks commented Jan 2, 2025

Hello @wannaphong! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:

There are currently no PEP 8 issues detected in this Pull Request. Cheers! 🍻

Comment last updated at 2025-01-02 13:57:39 UTC

@sonarqubecloud
Copy link

sonarqubecloud bot commented Jan 2, 2025

@coveralls
Copy link

coveralls commented Jan 2, 2025

Coverage Status

coverage: 52.728% (-0.06%) from 52.79%
when pulling ca9446d on add-calculate_ngram_counts
into 2252dee on dev.

@bact bact added the enhancement enhance functionalities label Jan 2, 2025
@wannaphong wannaphong merged commit 37f6ba8 into dev Jan 3, 2025
38 of 40 checks passed
@bact bact deleted the add-calculate_ngram_counts branch January 3, 2025 21:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement enhance functionalities

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

5 participants