Skip to content

Convert a string to a set of w-word shingles

Notifications You must be signed in to change notification settings

VidyasagarMSC/w-shingle

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 

Repository files navigation

w-shingle generator updated for Python 3.x

usage: w-shingle.py [-h] [-w W] string

Transform a string into tokens of length w.

positional arguments:
  string      the string to tokenize

optional arguments:
  -h, --help  show this help message and exit
  -w W        the number of words per shingle

Example

$ python w_shingle.py "a rose is a rose is a rose" -w 4
[['a', 'rose', 'is', 'a'], ['rose', 'is', 'a', 'rose'], ['is', 'a', 'rose', 'is'], ['a', 'rose', 'is', 'a'], ['rose', 'is', 'a', 'rose']]

About

Convert a string to a set of w-word shingles

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%