Skip to main content

A simple Python n-gram calculator

Project description

# A simple Python n-gram calculator.
#
# Given an arbitrary string, and the value of n as the size of the
# n-gram (int), this module will show you the results, sorted from
# most to least frequently occuring n-gram.
#
# The 'sort by value' operation for the dict follows the
# PEP 265 recommendation.
#
# Installation:
#
# user@host:~$ sudo pip install pyngram
#
# Quick start:
#
# >>> from pyngram import calc_ngram
#
# method expects inputstring as 1st arg, size of n-gram as 2nd arg
#
# >>> calc_ngram('bubble bobble, bubble bobble, bubble bobble', 3)
#
# or straight from your *nix shell prompt
#
# user@host:~$ ./pyngram.py
#
# Enjoy!
#
# Jay Liew
# @jaysern
#

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyngram-1.0.1.tar.gz (1.9 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page