1 | def exists(word):
|
2 | """Tell whether a word exists in the dictionary.
|
3 |
|
4 | Returns a true or false value only. Is meant to be quite fast.
|
5 | """
|
6 | pass
|
7 |
|
8 | def check(word, suggestions=1):
|
9 | """Return a suggested spelling for the given word.
|
10 |
|
11 | The optional parameter is used to specify how many alternate spellings the dictionary will return for the given word. If the word is in the dicionary, the first result returned will be the word itself.
|
12 | """
|
13 |
|
14 | def spelcheck(document, option=''):
|
15 | """Spell-check an entire document.
|
16 |
|
17 | When called with no other parameters, spelcheck will check every word in the given document against its dictionary, and return a list of problem words, their line numbers, and a suggested correction.
|
18 | When called with 'v' as a second parameter, spelcheck will return multiple suggestions for each mis-spelled word.
|
19 | When called with 'o' as a second parameter, spelcheck will return the given document with each problem word replaced by its most probable correct spelling (and no change for those words with no identifiable correct spelling.)
|
20 | """
|
21 | pass
|
22 |
|
23 | def add_word(word):
|
24 | """Adds a word to the current dictionary."""
|
25 | pass
|
26 |
|
27 | def delete_word(word):
|
28 | """Deletes this word from the current dictionary."""
|
29 | pass
|
30 |
|
31 | def import_dictionary(dictionary):
|
32 | """Import the given dictionary into the spell-checker."""
|
33 | pass
|
34 |
|
35 | def export_dictionary():
|
36 | """Exports the current dictionary in speling.py's proprietary format."""
|
37 | pass
|
38 |
|
39 | def import_rules(ruleset):
|
40 | """Import a given set of phonetic substitution rules for use by the dictionary.
|
41 |
|
42 | This function is important to the recent internationalisation attempts by the makers of speling.py. Language packages may be downloaded from our website, http://zesty.ca/spel, and loaded by calling import_dictionary and import_rules.
|
43 | """ |