mozIPersonalDictionary 编辑

extensions/spellcheck/idl/mozIPersonalDictionary.idlScriptable This interface represents a personal dictionary. 1.0 66 Introduced Gecko 1.4.1 Inherits from: nsISupports Last changed in Gecko 1.7

Implemented 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

AttributeTypeDescription
wordListnsIStringEnumeratorGet 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据

词条统计

浏览:125 次

字数:7512

最后编辑:7 年前

编辑次数:0 次

    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文