Apple Newton Utilities Guide de l'utilisateur Page 408

  • Télécharger
  • Ajouter à mon manuel
  • Imprimer
  • Page
    / 942
  • Table des matières
  • MARQUE LIVRES
  • Noté. / 5. Basé sur avis des utilisateurs
Vue de la page 407
CHAPTER 10
Recognition: Advanced Topics
10-32 Using Advanced Topics in Recognition
Note
Future versions of the system are not guaranteed to have the
autoAdd slot. You must verify that the returned value is non-nil
before using it.
Adding Words to the User Dictionary 10
The following code fragment uses the AddWord method of the reviewDict
object to add words to the user dictionary. After adding one or more words, you
must call the
SaveUserDictionary function to make your changes to the user
dictionary’s system soup entry persistent.
local reviewDict := GetRoot().reviewDict;
if reviewDict then
begin
reviewDict:AddWord("myWord");
reviewDict:AddWord("myOtherWord");
SaveUserDictionary();
end;
The AddWord method returns true if the word was added successfully and
returns
nil if the word was not added; however, this function may also return nil
due to resource limitations.
It is possible to run out of system memory for dictionaries, with potentially serious
consequences. Do not rely on a specic number as the maximum amount of
dictionary entries that may be added safely.
If the Personal Word List slip is open when you add words to the user dictionary,
its display is updated automatically. An undo action is posted for this update.
IMPORTANT
Do not use the AddWordToDictionary global function to add
words to the review dictionary.
Removing Words From the User Dictionary 10
The following code fragment uses the RemoveWord method of the reviewDict
object to remove a word from the user dictionary. After deleting the word, you
must call the
SaveUserDictionary function to write the changes to the user
dictionary’s system soup entry.
local reviewDict := GetRoot().ReviewDict;
if reviewDict then
begin
reviewDict:RemoveWord("myWord");
reviewDict:RemoveWord("myOtherWord");
SaveUserDictionary();
end;
Vue de la page 407
1 2 ... 403 404 405 406 407 408 409 410 411 412 413 ... 941 942

Commentaires sur ces manuels

Pas de commentaire