`Case 1:13-cv-00919—LPS Document 311-7 Filed 03/10/21 Page 1 of 201 PageID #: 29046
`
`EXHIBIT 64 PART 3
`
`EXHIBIT 64 PART 3
`
`
`
`Case 1:13-cv-00919-LPS Document 311-7 Filed 03/10/21 Page 2 of 201 PageID #: 29047
`
`CHAPT ER 1 0
`
`Recognition: Advanced Topics
`
`The wordlnfo frame provides methods that you can use to manipulate its
`contents; for more information, see "WordInfo Methods" (page 8-62) in Newton
`Programmer's Reference.
`
`The alternate interpretations of arecognized word are provided as wordInterp
`frames based on the protoWordlnterp system prototype. An array of
`wordInterp frames resides in the wordInfo frame's words slot.
`
`Each wordInterp frame contains the following information:
`n a string that is one interpretation of the original input strokes.
`n a score indicating the recognizer's confidence in the accuracy of the interpretation.
`n the dictionary identifier of the recognized word (for internal use only).
`n the position occupied by this word in the original list of interpretations returned
`by the recognizer.
`
`For more information, see the descriptions of the protoCorrectlnfo,
`protoWordInterp, and protoWordInfo prototypes in Newton Programmer's
`Reference.
`
`You can provide an optional ViewCorrectionPopupScript method that
`modifies or replaces the picker that displays correction information when a word is
`double-tapped. For a description of this method, see "Application-Defined
`Recognition Methods" (page 8-66) in Newton Programmer's Reference.
`
`Using Custom Dictionaries
`
`In addition to the system-supplied dictionaries, your application can use custom
`dictionaries to facilitate the recognition of specialized vocabulary such as medical
`or legal terms. It's relatively easy to create a RAM-based enumerated dictionary at
`run time; however, this approach is not recommended for dictionaries containing
`more than a few words.
`
`Note that you cannot cause the built-in applications (Names, Dates and so on) to
`use custom dictionaries. The only way to enable these applications to recognize
`specialized terminology is to add words to the user dictionary. However, you are
`strongly discouraged from doing so, because each entry added to the user dictionary
`reduces the amount of system RAM available to the user. For more information,
`see "System Dictionaries" beginning on page 9-11.
`
`Creating a Custom Enumerated Dictionary
`
`To create a custom enumerated dictionary, you must populate a blank RAM-based
`dictionary with your dictionary items. Dictionary items can come from a number of
`places: they might be elements of your own array of strings stored in the application's
`NTK project data; they might be represented as binary resource data in your
`
`10-24
`
`Using Advanced Topics in Recognition
`
`ARENDI-DEFS00004048
`
`
`
`Case 1:13-cv-00919-LPS Document 311-7 Filed 03/10/21 Page 3 of 201 PageID #: 29048
`
`CHAPT ER 1 0
`
`Recognition: Advanced Topics
`
`application's NTK project; they might be supplied by the user in an input line
`view; they might even arrive as serial data. Because dictionary items can originate
`from a number of sources, the example here presumes that you know how to store
`your word strings and pass them, one at a time, to the AddWordToDictionary
`function. This function adds its argument to the specified custom dictionary.
`
`The AddWordToDictionary function does not place any restrictions on the
`strings to be entered in the dictionary; however, your intended use of the dictionary
`entry may influence its content. For nonrecognition purposes, such as validating
`input to a field, any string is a valid dictionary entry. For use in stroke recognition,
`strings in enumerated dictionaries must not include spaces. The printed recognizer
`accepts the full set of ASCII characters; the cursive recognizer does not. Digits
`or non-alphabetic characters in dictionary entries used by the cursive recognizer
`must appear in the input string in order to be recognized. Do not use the
`AddWordToDictionary function to add items to the review dictionary; use the
`appropriate reviewDict methods instead.
`
`You can take the following steps to create a RAM-based enumerated dictionary at
`run time:
`
`1. Use the global function NewDictionary to create a new empty dictionary.
`
`2. Use the global function AddWordToDictionary to add dictionary items to
`the new dictionary.
`
`3. Use the global function GetDictionaryData to create abinary
`representation of the completed dictionary, which can then be stored in a soup.
`
`Another way to do this is to create a new dictionary and restore its data from a soup.
`
`The next several sections describe the numbered steps in greater detail. Following
`this discussion, the section "Restoring Dictionary Data From a Soup" (page 10-28),
`describes how to restore an existing dictionary from soup data.
`
`Creating the Blank Dictionary
`
`You can create a blank RAM-based dictionary anywhere in your application that
`makes sense; a common approach is to take care of this in the
`ViewsetupFormscript method of the application's base view. You must also
`create a slot in which to store the RAM-based dictionary. The following code
`fragment creates a dictionary in the mySpecialDictionary slot.
`
`ViewSetupFormScript := func()
`begin
`mySpecialDictionary := NewDictionary('custom);
`
`end
`
`This code example uses the NewDictionary function to create a blank dictionary
`in the mySpecialDictionary slot. The NewDictionary function accepts the
`
`Using Advanced Topics in Recognition
`
`10-25
`
`ARENDI-DEFS00004049
`
`
`
`Case 1:13-cv-00919-LPS Document 311-7 Filed 03/10/21 Page 4 of 201 PageID #: 29049
`
`CHAPT ER 1 0
`
`Recognition: Advanced Topics
`
`symbol I custom as its argument, which specifies that the new dictionary is for
`this application's use only.
`
`Note
`Although the token returned by the NewDictionary function
`currently evaluates to an integer in the NTK Inspector, the type of
`value returned by this function may change on future Newton
`devices. Do not rely on the NewDictionary function returning
`an integer.
`
`Adding Words to RAM-Based Dictionaries
`
`Once you have created a blank dictionary, you need to populate it with your
`dictionary items. You can use the AddWordToDictionary function to add a
`specified string to a specified RAM-based dictionary.
`
`The first argument to this function is the identifier of the dictionary to which the
`string is to be added; this identifier is returned by theNewDictionary function. The
`previous code example stored this identifier in the myspecialDictionary slot.
`
`The second argument to this function is the string to be added to the dictionary. If
`this argument is not a string, the AddWordToDictionary function throws an
`exception. If the word is added successfully, this function returns true. If the
`specified word cannot be added, this function returns n 1.
`
`The AddWordToDictionary function may return nil when the word to be
`added is already present in the specified dictionary, or it may return nil because of
`resource limitations. It is possible to run out of system memory for dictionaries,
`with potentially serious consequences. Do not rely on a specific number of
`dictionary entries as the maximum amount that may be added safely. It is strongly
`recommended that you use custom dictionaries sparingly and keep them as small as
`possible, taking into account the possibility that other applications may require
`system memory for their own dictionaries or for other uses.
`
`To populate the dictionary, you need to call the AddWordToDictionary
`function once for each item to be added. There are many ways to call a function
`iteratively; the best approach for your needs is an application-specific detail that
`cannot be anticipated here. The following code example shows one way to populate
`a blank dictionary.
`
`myAdder:= func()
`begin
`local element;
`// items slot contains an array of dictionary strings
`foreach element in items do
`AddWordToDictionary(myspecialDictionary, element);
`
`end
`
`10-26
`
`Using Advanced Topics in Recognition
`
`ARENDI-DEFS00004050
`
`
`
`Case 1:13-cv-00919-LPS Document 311-7 Filed 03/10/21 Page 5 of 201 PageID #: 29050
`
`CHAPT ER 1 0
`
`Recognition: Advanced Topics
`
`This approach works well for small dictionaries; for most large dictionaries,
`however, it is far more efficient to populate the dictionary from saved soup data.
`You should store custom dictionary data in a soup so that it is safely stored and
`persistent across soft resets.
`
`IMPORTANT
`Do not use the AddWordToDictionary global function to add
`words to the review dictionary; instead, use the appropriate review
`dictionary methods. A
`
`Removing Words From RAM-Based Dictionaries
`
`You can use the DeleteWordFromDictionary function to remove a specified
`word from a specified RAM-based dictionary. Note that this function does not
`make permanent changes to soups. After calling this function you must write your
`changes to the appropriate soup.
`
`IMPORTANT
`Do not use the DeleteWordFromDictionary function to
`remove words from the review dictionary; instead, use the
`appropriate review dictionary methods. A
`
`Saving Dictionary Data to a Soup
`
`Once you have added all of your dictionary entries, your RAM-based custom
`dictionary is ready for use. However, it would be inefficient to build it from scratch
`each time you need it, especially if it is large. Instead, you can store a binary
`representation of the dictionary data in a soup and use this soup data to restore the
`custom dictionary.
`
`The NewDictionary function returns an identifier used to reference the
`dictionary; in the previous example, this identifier was stored in the
`myspecialDictionary slot defined in the base view of the application. You can
`pass this identifier as the GetDictionaryData function's argument. This
`function returns a binary representation of the dictionary data (the words or items).
`You can then place this binary object in a slot in a frame and add the frame to a
`soup. The following code fragment assumes that the soup ksoupName is a valid
`soup created according to the Newton DTS soup-creation guidelines.
`
`// get a soup in which to save the data
`mySoup := GetUnionSoupAlways (ksoupName);
`// create binary representation of dictionary data
`local dict := GetRoot().appSym.mySpecialDictionary;
`local theObj:= GetDictionaryData(dict);
`
`Using Advanced Topics in Recognition
`
`10-27
`
`ARENDI-DEFS00004051
`
`
`
`Case 1:13-cv-00919-LPS Document 311-7 Filed 03/10/21 Page 6 of 201 PageID #: 29051
`
`CHAPT ER 1 0
`
`Recognition: Advanced Topics
`
`// store the dictionary data
`dictData := {data:theObj};
`mySoup:AddXmit(dictData, nil);
`
`Restoring Dictionary Data From a Soup
`
`To use the dictionary, your application needs to retrieve the dictionary data object
`from the soup and use the global function SetDictionaryData to install the
`data in an empty dictionary. This is typically done in the application part's
`InstallScript function or in the ViewSetupFormScript method of the
`view that uses the custom dictionary, as shown in the following code example:
`
`// make new blank dictionary
`mySpecialDictionary := NewDictionary('custom);
`get the dictionary data from the soup
`structure of query depends on how you store data
`dataCursor : = dictDataSoup: Query (querySpec) ;
`// how you get entry depends on how you store data
`myBinaryData := dataCursor:entry();
`// put data in dictionary
`SetDictionaryData(mySpecialDictionary, myBinaryData);
`
`Note that RAM-based dictionaries are lost when the system resets. However, the
`system calls your application part's Instal lScript function after areset. This
`function can determine whether the dictionary exists and recreate it if necessary.
`Because this function is also called when a card with your application on it is
`inserted, as well as when the application is installed initially, it provides an ideal
`place from which to install your custom dictionary.
`
`Using Your RAM-Based Custom Dictionary
`
`Take the following steps to make your RAM-based dictionary available to each
`view that is to use it for recognition:
`
`1. Set the view's vCustomDictionaries flag.
`
`2. Create a dictionaries slot. You can create this slot in the view itself or in its
`recConf ig frame.
`
`3. Place your dictionary's identifier in the dictionaries slot.
`
`To enable the use of custom dictionaries, you must set the vCustomDictionaries
`flag for the view that is to use the custom dictionary. This flag indicates that the
`view has access to a slot named dictionaries that specifies dictionaries to be
`used for recognition. The dictionaries specified in this slot are used in conjunction
`with any other dictionaries that may be specified for this view's use.
`
`10-28
`
`Using Advanced Topics in Recognition
`
`ARENDI-DEFS00004052
`
`
`
`Case 1:13-cv-00919-LPS Document 311-7 Filed 03/10/21 Page 7 of 201 PageID #: 29052
`
`CHAPT ER 1 0
`
`Recognition: Advanced Topics
`
`In addition to setting the view's vCustomDictionaries flag, you need to create
`a dictionaries slot in either the view or its recConf ig frame. The
`dictionaries slot stores a single dictionary identifier or an array of dictionary
`identifiers. You need to install the custom dictionary in this slot using code similar
`to the following example.
`
`// vCustomDictionaries flag already set
`dictionaries := mySpecialDictionary;
`
`To use system-supplied dictionaries in addition to your custom dictionary, you can
`enable additional view flags in the Entry Flags editor in NTK or set these
`additional flags procedurally. If you prefer to set view flags procedurally, you must
`use the Bor function to bitwise OR the vCustomDictionaries flag with any
`bits already set in the viewFlags slot. In either case, your custom dictionary must
`still be specified in the dictionaries slot.
`
`Note that some view flags enable combinations of system dictionaries. If you want
`to specify explicitly which system dictionaries the view can use, set no dictionary-
`enabling flags other than the vCustomDictionaries flag and use system-
`supplied dictionary ID constants to add specific dictionaries to the dictionaries
`slot. For descriptions of the system-supplied dictionary ID constants, see
`"System-Supplied Dictionaries" (page 8-16) in Newton Programmer's Reference.
`
`The following code fragment shows how you can specify dictionaries explicitly
`by including the appropriate constants as elements of the array in the
`dictionaries slot.
`
`dictionaries :=[mySpecialDictionary, kUserDictionary,
`kCommonDictionary]
`
`Regardless of the order of elements in the dictionaries array, the system
`always searches the user dictionary first. The system then searches all of the
`specified dictionaries in the order that they appear in the dictionaries array. In
`general, the order in which this array's items appear is not critical, except in the
`case of conflicting capitalization information for representations of the same word
`in multiple dictionaries. When multiple dictionary entries match the input, the
`system uses the first dictionary entry that was matched.
`
`Note that the printed recognizer can always return words not present in
`dictionaries. Only the cursive recognizer may be restricted to returning only words
`present in dictionaries (and then only when letter-by-letter recognition is not
`enabled). To test your dictionary settings, use the cursive recognizer while its
`letter-by-letter option is disabled.
`
`Using Advanced Topics in Recognition
`
`10-29
`
`ARENDI-DEFS00004053
`
`
`
`Case 1:13-cv-00919-LPS Document 311-7 Filed 03/10/21 Page 8 of 201 PageID #: 29053
`
`CHAPT ER 1 0
`
`Recognition: Advanced Topics
`
`Removing Your RAM-Based Custom Dictionary
`
`It is recommended that you remove your custom dictionary when it is no longer
`needed, such as when your application is removed. The DisposeDictionary
`function removes a specified RAM-based dictionary.
`
`The DisposeDictionary function accepts one argument, the dictionary identifier
`returned by NewDictionary. If this identifier was stored in a slot named
`mySpecialDictionary, a line of code similar to the following example would
`be used to remove the custom dictionary.
`
`DisposeDictionary(mySpecialDictionary);
`
`Using System Dictionaries Individually
`
`The system provides several constants that you can use to refer to system
`dictionaries conveniently; see "System-Supplied Dictionaries" (page 8-16) in
`Newton Programmer's Reference. You can set the vCustomDictionaries flag
`and place one or more of these constants in your view's dictionaries slot to
`specify explicitly the vocabulary it can recognize, such as first names only or
`names of days and months only. Note that a single constant may represent multiple
`dictionaries; for example, when the kCommonDictionary constant is specified,
`the system may actually add several dictionaries to the set that the view uses for
`recognition. The rest of this section describes the use of individual system dictionaries.
`
`The vNumbersAl lowed flag enables both the numeric lexical dictionary and the
`monetary lexical dictionary. To create a view that recognizes numeric values but
`not monetary values, set the vCustomDictionaries flag and place the
`kNumbersOn1yDictionary constant in the view's dictionaries slot.
`
`Note that both the vCustomDictionaries and vC ha. r sA 11 owe d fl ag s enable
`text recognition. The difference between these flags is in the set of dictionaries they
`enable. The vCustomDictionaries flag enables only those dictionaries specified
`by the dictionaries slot of the view performing recognition. The
`vCharsAl lowed flag, on the other hand, enables several system-supplied
`dictionaries. To avoid unexpected results when working with custom dictionaries,
`be aware that setting other flags may enable additional dictionaries. Remember,
`also, that the printed recognizer can always return words not appearing in dictionaries.
`
`Working With the Review Dictionary
`
`The review dictionary object provides methods for manipulating the contents of the
`user dictionary (personal word list), and the expand dictionary. Although the
`auto-add dictionary is also part of the review dictionary, the auto-add dictionary
`has its own interface.
`
`10-30
`
`Using Advanced Topics in Recognition
`
`ARENDI-DEFS00004054
`
`
`
`Case 1:13-cv-00919-LPS Document 311-7 Filed 03/10/21 Page 9 of 201 PageID #: 29054
`
`CHAPT ER 1 0
`
`Recognition: Advanced Topics
`
`Do not use the global functions AddWordToDictionary and
`RemoveWordFromDictionary to make changes to the review dictionary;
`instead, use the appropriate review dictionary methods.
`
`The dictionaries themselves are stored as entries in the system soup. This section
`describes how to manipulate these dictionaries programmatically. All of the
`functions and methods named in this section are described completely in "User
`Dictionary Functions and Methods" beginning on page 10-54.
`
`Retrieving the Review Dictionary
`
`To manipulate the contents of the user dictionary or expand dictionary, you send
`messages to the reviewDict object, which resides in the root view.
`
`To obtain a reference to the reviewDict object, you can use code similar to the
`following example.
`
`local reviewDict := GetRoot().reviewDict;
`
`Note
`Future versions of the system are not guaranteed to have the
`ReviewDict slot. You must verify that the returned value is
`non-nil before using it.
`
`You usually do not need to load the review dictionary into RAM yourself—the
`system does so automatically when it is reset and most flags that enable text
`recognition include the user dictionary automatically in the set of dictionaries they
`enable. You usually do not need to load the auto-add or expand dictionaries explicitly,
`either—the user dictionary consults these additional dictionaries automatically.
`However, the LoadUserDictionary, LoadExpandDictionary, and
`LoadAutoAddDictionary functions are provided for your convenience.
`
`For general information about the user dictionary, expand dictionary and auto-add
`dictionary, see "System Dictionaries" beginning on page 9-11.
`
`Displaying Review Dictionary Browsers
`
`You can send the open message to the reviewDict object to display the Personal
`Word List slip. If words have been added to the auto-add dictionary, this function
`displays the Recently Written Words slip automatically as well.
`
`To display the Recently Written Words slip alone, send the open message to
`the autoAdd object residing in the system's root view, as shown in the
`following example.
`
`local auto := GetRoot().autoAdd:Open();
`if auto then auto:Open();
`
`Using Advanced Topics in Recognition
`
`10-31
`
`ARENDI-DEFS00004055
`
`
`
`Case 1:13-cv-00919-LPS Document 311-7 Filed 03/10/21 Page 10 of 201 PageID #: 29055
`
`CHAPT ER 1 0
`
`Recognition: Advanced Topics
`
`Note
`Future versions of the system are not guaranteed to have the
`autoAdd slot. You must verify that the returned value is non-ni 1
`before using it.
`
`Adding Words to the User Dictionary
`
`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 specific 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. A
`
`Removing Words From the User Dictionary
`
`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;
`
`10-32
`
`Using Advanced Topics in Recognition
`
`ARENDI-DEFS00004056
`
`
`
`Case 1:13-cv-00919-LPS Document 311-7 Filed 03/10/21 Page 11 of 201 PageID #: 29056
`
`CHAPT ER 1 0
`
`Recognition: Advanced Topics
`
`The Removeword method returns true if the word was removed successfully and
`returns n 1 if the word was not removed. This method returns n 1 and does not
`remove the specified word if there are differences in case between the word in the
`dictionary and the word passed as the argument to the Removeword method. This
`method also returns n 1 when the word to be removed is not present in the
`review dictionary.
`
`IMPORTANT
`Do not use the RemoveWordFromDictionary global function
`to make changes to the review dictionary; instead, use the
`appropriate review dictionary methods. A
`
`Adding Words to the Expand Dictionary
`
`The expand dictionary (the dictionary that defines word expansions) is kept in RAM,
`and its size is limited to 256 words. To manipulate the expand dictionary, you send
`messages to the reviewDict object residing in the root view. The system provides
`methods for adding words and their associated expansions to this dictionary;
`retrieving the expansions associated with words; removing words and expansions
`from this dictionary; and saving expansion dictionary changes to the system soup.
`To add a word and its expansion to the expand dictionary, you must send the
`AddExpandWord message to the reviewDict object. Words added to the
`expand dictionary must first be recognized and present in the user dictionary. If
`necessary, you can use the AddWord method of the reviewDict object to add
`the word to the user dictionary before adding it to the expand dictionary. After
`adding one or more words to the expand dictionary, you must call the
`SaveExpandDictionary function to write your changes to the system soup, as
`the following code fragment illustrates.
`
`local reviewDict := GetRoot().ReviewDict;
`// word must be present in user dict before adding to expand dict
`if reviewDict then
`begin
`if not LookupWordInDictionary(reviewDict, "BTW") then
`begin
`reviewDict:AddWord("BTW");
`SaveUserDictionary();
`end;
`reviewDict:AddExpandWord("BTW", "by the way");
`// write changes to system soup
`SaveExpandDictionary();
`end;
`
`Using Advanced Topics in Recognition
`
`10-33
`
`ARENDI-DEFS00004057
`
`
`
`Case 1:13-cv-00919-LPS Document 311-7 Filed 03/10/21 Page 12 of 201 PageID #: 29057
`
`CHAPT ER 1 0
`
`Recognition: Advanced Topics
`
`Removing Words From the Expand Dictionary
`
`Normally, words are added to both the expand dictionary and the user dictionary
`simultaneously. As a result, words removed from the expand dictionary generally
`must also be removed from the user dictionary. The following code fragment uses
`the Removeword method to remove a word from both the expand and the user
`dictionaries. After deleting the word, you must call the SaveUserDictionary
`function to write the changes to the system soup.
`
`local reviewDict := GetRoot().ReviewDict;
`if reviewDict then
`begin
`// remove word & expansion from dictionaries
`reviewDict:RemoveWord("BTW");
`SaveUserDictionary();
`end;
`
`Retrieving Word Expansions
`
`The following code fragment uses the GetExpandedWord method of the
`reviewDict object to retrieve the expansion associated with a specified word.
`This method returns n 1 if the specified word is not found in the expand dictionary.
`
`local reviewDict := GetRoot().ReviewDict;
`if reviewDict then
`local theExpansion := reviewDict:GetExpandedWord("BTW");
`
`Retrieving the Auto-Add Dictionary
`
`The auto-add dictionary (the list of new words to add to the user dictionary
`automatically) resides in RAM and its size is limited to 100 words. The system
`adds new words to this dictionary automatically when the cursive recognizer is
`enabled and the Add New Words to Personal Word List checkbox in the Text
`Editing Settings preferences slip is selected.
`
`The Recently Added Words slip provides the NewtonScript interface to the
`auto-add dictionary. You can use code similar to the following example to obtain a
`reference to the RecentlyAdded Words slip.
`
`local autoAddDict := GetRoot().AutoAdd;
`
`Note
`Future versions of the system are not guaranteed to have this
`slot. You must verify that the returned value is non-ni 1 before
`using it.
`
`10-34
`
`Using Advanced Topics in Recognition
`
`ARENDI-DEFS00004058
`
`
`
`Case 1:13-cv-00919-LPS Document 311-7 Filed 03/10/21 Page 13 of 201 PageID #: 29058
`
`CHAPT ER 1 0
`
`Recognition: Advanced Topics
`
`Usually, you do not need to load the auto-add dictionary into RAM yourself—the
`system does so automatically whenever the Personal Word List slip is opened or
`the system is reset. However, the system provides the LoadAutoAddDictionary
`function for your convenience.
`
`Disabling the Auto-Add Mechanism
`
`When the cursive recognizer is enabled, words not appearing in any of the
`currently enabled dictionaries are added to the auto-add and user dictionaries
`automatically as they are recognized or corrected. The value of the doAutoAdd
`slot in the system's user configuration data controls this default behavior.
`
`However, not all input to a view is appropriate to add to dictionaries; for example,
`consider a spreadsheet that allows the user to select cells by entering row and
`column numbers—you wouldn't want to add these strings to the dictionaries as
`they are recognized To disable the automatic addition of new words to the user and
`auto-add dictionaries, you can use either of the following techniques:
`n Set the _noautoadd slot in the view or its recConf ig frame to a
`non-nil value.
`n Set the _noautoadd slot in the word's wordInfo frame to a non-nil
`value. You can get a word's wordInfo frame by calling the
`GetCorrectionWordlnfo function from within the view's
`ViewWordScript method.
`
`Alternatively, you can set the value of the doAutoAdd slot in the system's user
`configuration data to nil and call the ReadCursiveoptions function; however,
`it is not recommended that you change user configuration settings without first
`obtaining confirmation from the user.
`
`Adding Words to the Auto-Add Dictionary
`
`The AddAutoAdd function adds a specified word to both the user and auto-add
`dictionaries. This function returns the value true after adding the word
`successfully. The word is not added if its unpunctuated form is present in the
`standard set of dictionaries enabled by the vCharsAl lowed flag.
`
`If the auto-add dictionary already contains its maximum of 100 words, this
`function does not add the new word but displays the notify icon instead. When the
`user taps the notify icon, it posts a notify action that displays the Recently Written
`Words slip. The user can then edit the Recently Written Words slip before
`attempting to add more words; if the user responds immediately, no new words are
`lost. For more information on the notify icon and notify actions, see Chapter 17,
`"Additional System Services."
`
`Using Advanced Topics in Recognition
`
`10-35
`
`ARENDI-DEFS00004059
`
`
`
`Case 1:13-cv-00919-LPS Document 311-7 Filed 03/10/21 Page 14 of 201 PageID #: 29059
`
`CHAPT ER 1 0
`
`Recognition: Advanced Topics
`
`Removing Words From the Auto-Add Dictionary
`
`The RemoveAutoAdd function deletes a specified word from both the user and
`auto-add dictionaries. This function returns true if the word was removed and
`returns n 1 if the word was not removed. This method does not remove the word if
`it is not present in the auto-add dictionary or if there are case inconsistencies
`between the argument to this function and the word actually found in the dictionary.
`
`Using protoCharEdit Views
`The protoCharEdit proto provides a comb-style view that facilitates the
`correction of individual characters in misrecognized words. The view provided by
`this proto uses an rcGridlnfo frame internally to provide a horizontal row of
`single-character input areas. The system-supplied corrector available from the
`picker displayed when the user taps a recognized word makes use of this view.
`Figure 10-7 illustrates a typical protoCharEdit view.
`
`Figure 10-7
`
`Example of a protoCharEdit view
`
`b. e S t
`
`This section describes how to position aprotoCharEdit view, how to manipulate
`the text string it displays, and how to restrict its input to a specified set of characters.
`
`Positioning protoCharEdit Views
`
`There are two ways to position a protoCharEdit view within its parent view.
`You can set the values of its top and 1 e f t slots to values that position it at the top
`left corner of the view, or you can provide a similar value for its vi ewBounds slot.
`
`If you specify the values of the top and 1 e f t slots, then the
`ViewSetupFormScript method of the protoCharEdit view supplies an
`appropriate value for the vi ewBounds slot based on the values of the
`cellHeight, cellWidth, and maxChars slots. On the other hand, if you
`provide the values of the viewBounds and cellWidth slots, then this view
`supplies appropriate values for the maxChars and cellHeight slots foryou.
`This proto provides useful default values for the cellWidth and cellHeight
`slots; it is recommended that you do not change these values.
`
`The technique you use depends on how you want to set the slots that this proto
`provides. For detailed information, see "protoCharEdit" (page 8-41) in Newton
`Programmer's Reference.
`
`10-36
`
`Using Advanced Topics in Recognition
`
`ARENDI-DEFS00004060
`
`
`
`Case 1:13-cv-00919-LPS Document 311-7 Filed 03/10/21 Page 15 of 201 PageID #: 29060
`
`CHAPT ER 1 0
`
`Recognition: Advanced Topics
`
`Manipulating Text in protoCharEdit Views
`
`The default view provided by the protoCharEdit proto is an unformatted comb
`view (see page 10-4). You can provide an optional template that customizes this
`view's appearance and behavior. The template itself is a frame residing in the view's
`template slot. This frame may provide the following slots and methods:
`n The template's f i 1 t e r slot defines a set of permissible input values. For
`example, a view for correcting phone numbers might restrict the set of
`permissible characters to numerals.
`n The template's format slot can specify the length of the comb view and the
`editing characteristics of its entry fields. For example, the phone number
`correction view might use a format template to restrict input to a fixed number
`of characters and make certain entry fields non-editable. When the comb view
`erases invalid characters it displays the animated cloud and plays the ROM_poof
`sound that normally accompanies