Home | Trees | Index | Help |
|
---|
Package nltk_lite :: Module utilities |
|
Classes | |
---|---|
Counter |
A counter that auto-increments each time its value is read. |
MinimalSet |
Find contexts where more than one possible target value can appear. |
SortedDict |
A very rudamentary sorted dictionary, whose main purpose is to allow dictionaries to be displayed in a consistent order in regression tests. |
Function Summary | |
---|---|
Calculate the Levenshtein edit-distance between two strings. | |
filestring(f)
| |
Pretty print a sequence of data items | |
Pretty print a string, breaking lines on whitespace | |
string
|
Search string for substrings matching regexp
and wrap the matches with braces. |
_edit_dist_init(len1,
len2)
| |
_edit_dist_step(lev,
i,
j,
c1,
c2)
|
Function Details |
---|
edit_dist(s1, s2)Calculate the Levenshtein edit-distance between two strings. The edit distance is the number of characters that need to be substituted, inserted, or deleted, to transform s1 into s2. For example, transforming "rain" to "shine" requires three steps, consisting of two substitutions and one insertion: "rain" -> "sain" -> "shin" -> "shine". These operations could have been done in other orders, but at least three steps are needed.
|
pr(data, start=0, end=None)Pretty print a sequence of data items
|
print_string(s, width=70)Pretty print a string, breaking lines on whitespace
|
re_show(regexp, string)Searchstring for substrings matching
regexp and wrap the matches with braces. This is
convenient for learning about regular expressions.
|
Home | Trees | Index | Help |
|
---|
Generated by Epydoc 2.1 on Tue Sep 5 09:37:21 2006 | http://epydoc.sf.net |