Next: , Previous: object records, Up: MOZ Records



7.2 verbs records

Verbs records are rather complex:

     allVerbs(
         en: verbs(
     	get: verb(
     	    method: get
     	    parses: [
     		exampleParseName(
     		    leftMostPreposition: lmp(
     			prep: [ 'from' 'out of' ]
     			leftSide: lhs(
     			    objectName: getObject
     			)
     			rightSide: rhs(
     			    objectName: fromObject
     			)
     		    )
     		]
     	    )
     	)
         )
         lb: verbs(
     	cpacu: verb(
     	    method: get
     	    parses: [
     		exampleParseName(
     		    objectName: getObject
     		    objectName: fromObject
     		)
     	    ]
     	)
         )
     )

The outermost record is rather like the strings record. Each language's sub-record contains one field for each known verb. Each verb record contains the method that verb is associated with and a list of parse records1, which contains instructions for parsing the user input (less the first word, which is always the verb) and turning it into arguments that the verb method will understand.

The verb record is used as an index on a dictionary which is used to store the parsing we have done and to make sure that we don't parse the same input the same way more than once if we can avoid it.

The example above would be appropriate on an object with a method like this:

     meth get( getObject: GetObject fromObject: FromObject )
     ...
     end

Footnotes

[1] The parse record part of the verb records is in such a drastic state of flux right now that I'm not even going to try to document it. It eventually needs its own section, but that might belong in the programmer's manual.