mozIPersonalDictionary 编辑
extensions/spellcheck/idl/mozIPersonalDictionary.idl
Scriptable This interface represents a personal dictionary. 1.0 66 Introduced Gecko 1.4.1 Inherits from: nsISupports
Last changed in Gecko 1.7Implemented by: @mozilla.org/spellchecker/personaldictionary;1
. To access this service, use
var personalDictionary = Components.classes["@mozilla.org/spellchecker/personaldictionary;1"] .getService(Components.interfaces.mozIPersonalDictionary);
Method overview
void addCorrection(in wstring word,in wstring correction, in wstring lang); |
void addWord(in wstring word, in wstring lang); |
boolean check(in wstring word, in wstring lang); |
void endSession(); |
void getCorrection(in wstring word, [array, size_is(count)] out wstring words, out PRUint32 count); |
void ignoreWord(in wstring word); |
void load(); |
void removeCorrection(in wstring word,in wstring correction, in wstring lang); |
void removeWord(in wstring word, in wstring lang); |
void save(); |
Attributes
Attribute | Type | Description |
wordList |
| Get the (lexicographically sorted) list of words. Read only. |
Methods
addCorrection()
Adds a misspelling to the list of corrections. Note that this method is not currently implemented.
void addCorrection( in wstring word, in wstring correction, in wstring lang );
Parameters
word
- The incorrect spelling of the word to add to the list of corrections.
correction
- The correct spelling of the word.
lang
- The language of the word.
addWord()
Add a word to the personal dictionary.
void addWord( in wstring word, in wstring lang );
Parameters
word
- The word to add to the dictionary.
lang
- The language of the word. Note that this parameter is currently unused.
check()
Checks a Unicode string.
boolean check( in wstring word, in wstring lang );
Parameters
word
- The word to check.
lang
- The language of the word. Note that this parameter is currently ignored.
Return value
true
if the word is in either the dictionary or the ignore list, false
if it is not in either list.
endSession()
Clears the ignore list.
void endSession();
Parameters
None.
getCorrection()
Gets a list of previous corrections for the word.
void getCorrection( in wstring word, [array, size_is(count)] out wstring words, out PRUint32 count );
Parameters
word
- The word to get the list of corrections for.
words
- The list of corrections.
count
- The number of corrections in the list.
ignoreWord()
Adds a word to the ignore all list.
void ignoreWord( in wstring word );
Parameters
word
- The word to add to the ignore list.
load()
Loads the dictionary.
void load();
Parameters
None.
removeCorrection()
Removes a misspelling from the list of corrections. This removes a single misspelling and correction pair from the list.
void removeCorrection( in wstring word, in wstring correction, in wstring lang );
Parameters
word
- The incorrect spelling of the word to remove from the list of corrections.
correction
- The correct spelling of the word.
lang
- The language of the word.
Notes
Only an entry matching both word
and correction
will be removed from the list of corrections.
removeWord()
Removes a word from the personal dictionary.
void removeWord( in wstring word, in wstring lang );
Parameters
word
- The word to remove.
lang
- The language of the word. Note that this parameter is currently ignored.
save()
Saves the dictionary.
void save();
Parameters
None.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论