Squeak Class Documentation category index | class index  
 
CRDictionary
  category: Genie-Engine
  superclass: Model
  subclasses:

This class represents a genie character dictionary.
The important instance variables and its functions are:

name <Symbol>
The name is used to identify the dictionary. The name can be empty. In this case,
the dictionary doesn't appear in the dictionary instance browser (the browser showing
all the dictionaries). This can be useful to define simple dictionaries, that are assigned to
special Morph instances. If a dictionary has a name, the name must be unique.
Dictionary names are used to specify parent dictionaries.

exportedName <Symbol>
The exported-name of a dictionary is used to assign dictionaries to Morph subclasses and
special Morph instances. This means that all the dictionary names specified by morphs are
exported names!
Usage example: Lets assume that there are two users, Peter and Paul with dictionaries
called 'Peter Text', 'Peter Text with Capital letters" and 'Paul Text'. Let's further assume that
all the text-based Morphs refer to a dictionary with the exported name 'Text'. The active
dictionary for all these Morphs can now be easily changed just by exporting the right
dictionary as 'Text'.

parents <Collection>
All the direct parents of the dictiionaries.
There is no parent limit and parent hierarchies can contain cycles!

parameters <CRParameters>
There are a lot of different parameters that can be assigned to character dictionaries
(relevance of the feature size, alert if match is too bad, ...). The parameters of
each dictionary are stored here.
NOTE: Inherited dictionaries can have different parameters! This can e.g. be very useful
if someone wants to have size independent strokes in a dictionary that is basically size
sensitive.

instance methods
  accessing
  addParent:
addParentName:
capturedPoints
exportedName
exportedName:
exportedNameAsString
fillFeaturesCache
fillFeaturesCacheIfNotFull
getParentsAndErrorForString:
indirectParentCount
indirectParents
lookup:
lookup:minResultSize:
lookup:minResultSize:symmetric:
lookup:minResultSize:symmetric:maxSpeed:
maxMultipleDefinitions
maxMultipleDefinitions:
name
name:
name:makeDistinct:
nameAsString
parameters
parentCount
parentFromName:
parentMenuSelector:
parents
parents:
parentsAsString
parentsFromString:
recalculate
releaseFeaturesCache
removeAllParents
removeParent:
storeAllCapturedPoints
storeNoCapturedPoints
storeReducedCapturedPoints
totalMaxMultipleDefinitions
totalParentCount
totalSize
updateMaxMultipleDefinitions
updateMaxMultipleDefinitions:
versionNO

  accessing dictionaries
  addChild:
atChar:
atChar:ifAbsent:
atCharString:
atFeature:
atFeature:ifAbsent:
atFeature:put:
charSize
featureSize
featuresAndCharsDo:
includesChar:
includesFeature:
indirectParentIncludesFeature:
isEmpty
notEmpty
removeChar:
removeChar:ifAbsent:
removeFeature:
removeFeature:ifAbsent:
renameChar:to:
selfOrIndirectParentIncludesFeature:
size
updateInvertedDictionary

  comparing
  <

  copying
  copy

  initialize-release
  initialize

  objects from disk
  basicReadDataFrom:size:
basicStoreDataOn:
readDataFrom:size:
storeDataOn:
storeParents
storeParents:
storedName
storedName:

  private
  addIndirectParentsTo:
addToInvertedDictionaryFeature:char:
capturedPoints:
createDistinctName:collection:
createParentsCollection
dictionary
dictionary:
getNameAndVersionFromString:
getNameAndVersionString
invertedDictionary
invertedDictionary:
localLookup:symmetric:maxSpeed:result:
parameters:
reduceCapturedPoints
removeCapturedPoints
replaceBy:
versionNO:

  testing
  hasAllCapturedPoints
hasNoCapturedPoints
hasParents
hasReducedCapturedPoints
isActive

  update
  updateToVersion2000

  updating
  update:

  views
  asCloseableMorph
asMorph
browserAppModel
newBrowser
newCloseableMorph
newMorph
openBrowser
openMorph

class methods
  class initialization
  initialize

  constants
  fileNameSuffix

  default values
  capturedPoints

  exported instances
  exportedName:
initializeExportedInstanceDictionary
updateExportedInstanceDictionary

  instance browser
  initializeInstanceBrowser
instanceBrowser
instanceBrowserMorph
openInstanceBrowserMorph

  instance creation
  new

  named instances
  addNamesToMenu:target:selector:
chooseTextDictionary
name:
setTextDictionary:

  private
  nameVersionSeparationCharacter

  update
  updateToVersion2000

  version
  versionNO

instance methods
  accessing top  
 

addParent:


 

addParentName:


 

capturedPoints


 

exportedName


 

exportedName:

Set exported name. If it's nil or empty, remove it from the instance browser


 

exportedNameAsString


 

fillFeaturesCache


 

fillFeaturesCacheIfNotFull


 

getParentsAndErrorForString:

Takes a string of parent dictionary names and returns an array containing
the references to the parent dictionaries named in the string and an error message string


 

indirectParentCount

Sum of direct and indirect parents!


 

indirectParents

Direct and indirect parents


 

lookup:

Lookup a feature with the default parameters of this dictionary


 

lookup:minResultSize:


 

lookup:minResultSize:symmetric:


 

lookup:minResultSize:symmetric:maxSpeed:


 

maxMultipleDefinitions

Max. number of different strokes for one character


 

maxMultipleDefinitions:


 

name

Answer a name for the receiver. This is used generically in the title of certain inspectors, such as the referred-to inspector, and specificially by various subsystems. By default, we let the object just print itself out..


 

name:


 

name:makeDistinct:

Set the name of the dictionary and make it distinct if aBooleean is true


 

nameAsString


 

parameters


 

parentCount


 

parentFromName:


 

parentMenuSelector:

Menu of all parents


 

parents


 

parents:


 

parentsAsString


 

parentsFromString:


 

recalculate

Calculate all the dictionary features with the current parameters


 

releaseFeaturesCache


 

removeAllParents


 

removeParent:


 

storeAllCapturedPoints

Store all captured points for festures in the dictionary.
Affects both, old and new features!


 

storeNoCapturedPoints

Store no captured points for festures in the dictionary.
Affects both, old and new features!


 

storeReducedCapturedPoints

Store reduced captured points for festures in the dictionary.
Affects both, old and new features!


 

totalMaxMultipleDefinitions

As maxMultipleDefinitions, but including all the parent dictionaries


 

totalParentCount


 

totalSize


 

updateMaxMultipleDefinitions


 

updateMaxMultipleDefinitions:


 

versionNO


  accessing dictionaries top  
 

addChild:


 

atChar:


 

atChar:ifAbsent:


 

atCharString:


 

atFeature:


 

atFeature:ifAbsent:


 

atFeature:put:


 

charSize


 

featureSize


 

featuresAndCharsDo:


 

includesChar:


 

includesFeature:


 

indirectParentIncludesFeature:


 

isEmpty


 

notEmpty


 

removeChar:


 

removeChar:ifAbsent:


 

removeFeature:


 

removeFeature:ifAbsent:


 

renameChar:to:


 

selfOrIndirectParentIncludesFeature:


 

size

Primitive. Answer the number of indexable variables in the receiver.
This value is the same as the largest legal subscript. Essential. See Object
documentation whatIsAPrimitive.


 

updateInvertedDictionary


  comparing top  
 

<

Used to sort dictionaries in the instance browser


  copying top  
 

copy

Answer another instance just like the receiver. Subclasses typically
override this method; they typically do not override shallowCopy.


  initialize-release top  
 

initialize


  objects from disk top  
 

basicReadDataFrom:size:


 

basicStoreDataOn:


 

readDataFrom:size:

Read data and make sure that all the StrokeFeatures use IntegerArray resp.
PointArray where possible.


 

storeDataOn:

Store myself on a DataStream. Answer self. This is a low-level DataStream/ReferenceStream method. See also objectToStoreOnDataStream. NOTE: This method must send 'aDataStream beginInstance:size:' and then (nextPut:/nextPutWeak:) its subobjects. readDataFrom:size: reads back what we write here.


 

storeParents

Shall parents be stored too? Only used while storing


 

storeParents:

Shall parents be stored too? Only used while storing


 

storedName

Only for internal use while loading dictionaries


 

storedName:

Only for internal use while loading dictionaries


  private top  
 

addIndirectParentsTo:

Add all the direct and indirect parents to aCollection


 

addToInvertedDictionaryFeature:char:


 

capturedPoints:

Shall captured points be stored?
Possible symbols: #all. #reduced. #none


 

createDistinctName:collection:

Create a name similar to aString that is not in aCollection


 

createParentsCollection


 

dictionary


 

dictionary:


 

getNameAndVersionFromString:

Find last pattern!


 

getNameAndVersionString


 

invertedDictionary


 

invertedDictionary:


 

localLookup:symmetric:maxSpeed:result:

Lookup aCRFeature in the local dictionary and store the result in aCRLookupResult.
If aBoolean is true, symmetric distances are used for the lookup
(means (A dist: B) = (B dist: A)).
speedIntegerOrNil determines the maximum speed (0 max accuracy; 100 max. seed).


 

parameters:


 

reduceCapturedPoints

Reduce the captured points of all my features


 

removeCapturedPoints

Remove the captured points of all my features


 

replaceBy:

Replace this dictionary by aCRDictionary.
All the children's are updated and this dictionary is deleted (name is set to nil)


 

versionNO:


  testing top  
 

hasAllCapturedPoints


 

hasNoCapturedPoints


 

hasParents


 

hasReducedCapturedPoints


 

isActive


  update top  
 

updateToVersion2000

Updates all older dictionaries to version 2000


  updating top  
 

update:

Split argument into object and symbol


  views top  
 

asCloseableMorph

Return a closable morph representing this dictionary


 

asMorph

Return a morph (with layout) representing this dictionary


 

browserAppModel

Return the application model of browsers displaying my contents.
To save space, usually only one model is created


 

newBrowser

Create a new browser displaying my contents


 

newCloseableMorph

Create a new closeable morph representing me


 

newMorph

Create a new morph representing me


 

openBrowser

Open a new browser showing my contents


 

openMorph

Open a new morph representing me


class methods
  class initialization top  
 

initialize

CRDictionary initialize


  constants top  
 

fileNameSuffix

The default file name suffix for a Genie Gesture Dictionary


  default values top  
 

capturedPoints

This is the default value for a newly created dictionary.
It determines, how the captured points of features in the dictionary are stored:
#all: All the captured points are stored.
#reduced: Only a reduced set of the captured points are stored.
#node: None of the captured points are stored.


  exported instances top  
 

exportedName:

Returns the instance with the given exported name.
For a fast lookup, the instances with an exported name are stored in a dictionary
of the class (ExportedInstanceDictionary)


 

initializeExportedInstanceDictionary

Initialize the dictionary of all the instances with an exported name.
The exported instances could also be accessed using the instance collection,
but it would be slower.


 

updateExportedInstanceDictionary

Update the dictionary containing the instances with an exported name


  instance browser top  
 

initializeInstanceBrowser

Create a new instance browser holding all the named dictionary instances.
An instance browser is stoed in the variable InstanceBrowser and can be accessed
using: CRDictionary instanceBrowser


 

instanceBrowser


 

instanceBrowserMorph


 

openInstanceBrowserMorph


  instance creation top  
 

new

Answer a new instance of the receiver (which is a class) with no indexable variables. Fail if the class is indexable.


  named instances top  
 

addNamesToMenu:target:selector:


 

chooseTextDictionary


 

name:

Returns the instance with the given exported name.


 

setTextDictionary:


  private top  
 

nameVersionSeparationCharacter


  update top  
 

updateToVersion2000

Updates all older dictionaries to version 2000


  version top  
 

versionNO