% types FlatFwd ModelArray DurationSet Word Cbcfg SampleSet DVector PTree HMM AModel Rewrite CodebookSet Vocab FMatrix CodebookMapItem PTreeSet MLNorm Dscfg PathItemList Question DictWord MLAdaptItem CodebookAccu HypoList DBaseIdx SampleSetClass SenoneTag Feature QuestionSet Dictionary DBase Lm PhonesSet DCovMatrix Phone FBMatrix Phones DistribAccu IMatrix TreeNode Distrib MLAdapt List Tag TopoSet SVector XWModel IArray DMatrix FVector StateGraph FCovMatrix XWModelSet PathItem FArray Duration PTreeNode LatNode Hypo Senone TreeFwd LDA Topo MLNormClass SenoneSet Lattice WordGraph Codebook Tags LDAClass FeatureSet Tree PhoneGraph CodebookMap Path TmSet DistribStream DistribSet Search AModelSet RewriteSetThe list you get here depends on the version and compile options. You create an object when you enter a type name followed by the name of the new object. Some types require additional arguments, like subobjects. As an example we define an object (let's call it 'ps') of type PhonesSet. You can get a list of all objects you have defined with the command 'objects'. One object name can only be used once (also for different types) but you can 'destroy' objects. 'destroy' is a standard method of every object (s.b.).
% PhonesSet ps ps % PhonesSet ps WARNING itf.c(0287)Object ps already exists. % PhonesSet ps2 ps2 % objects ps ps2
types | list all object types |
objects | list all objects defined by user |
type | give the type of the object |
puts | print contents of the object |
configure | configure the object |
: | allow access to list element |
. | allow access to subobjects |
destroy | destroy object |
To find out what other methods exist we enter eather the type name without any object name or the object name follwed by '-help'. To get more information about a specific method we enter the object name, the method and '-help'.
% ps -help DESCRIPTION A 'PhonesSet' object is a set of 'Phones' objects. METHODS puts displays the contents of a set of phone-sets add add new phone-set to a set of phones-set delete delete phone-set(s) from a set of phone-sets read read a set of phone-sets from a file write write a set of phone-sets into a file index return index of named phone-set(s) name return the name of indexed phone-set(s) % ps add -help Options of 'add' are: < name> name of list (string:"NULL") < phone*> list of phones % ps add VOWEL A E I O UWe just added the element 'VOWEL' to the PhonesSet object ps. To see the contents of the object we can use the method 'puts' or just the object name which is the same in most cases.
% ps puts VOWEL % ps VOWEL
% ps: VOWEL % ps:VOWEL A E I O U % ps type PhonesSet % ps:VOWEL type PhonesLet's assume we have also defined a phone group 'PHONES' in the PhonesSet 'ps' that contains all the Phones of a dictionary. Then we can create a dictionary object that needs the name of a Phones object and of a Tags object as arguments. Both have to be created first.
% Tags ts ts % Dictionary d ps:PHONES ts d % d add DOG "D O G" % d add DUCK "D U CK" % d. phones tags item(0..1) list % d: DOG DUCKWith 'd.phones', for example, you have access to the object 'ps:PHONES'. Although there is a method for PhonesSet to delete elements like 'PHONES' you will get an error if you try that because it was locked as you defined the dictionary. This prevents objects from being deleted while they are being used by other objects.
% ps configure {-useN 1} {-commentChar {;}} {-itemN 2} {-blkSize 20} % ps configure -commentChar {;} % ps configure -commentChar #Note: The old comment sign ';' was protected with curly braces {} because it is the command separator in Tcl.
Question: Can you explain the following line and its return value.
% ps configure -commentChar ; #