Exercise 9 thoughtsSeptember 6, 2008
It feels good to have completed the next exercise after the long haul implementing exercise 8... the hope was that I wouldn't burn out and stall making more progress, so this is a good sign.
Adding parametric relationships as a transformation output was fairly challenging. It made me realize that I needed to generalize the transformation process so that, regardless of the output specification's structure, the same logic could be applied. Hopefully this will pay dividends as I continue to add new transformation types.
Exercise 9: Relationships with propertiesSeptember 6, 2008
SummaryThe core objective of exercise 9 is to allow relationships to be defined that themselves have parameters. For example:
| person has(count:0+) sister |
|
This says that a person can have 0 or more sisters. It defines the base relationship
person has sister and then attaches the property
count = 0+ to that relationship. Another way it could be notated:
| (person has sister).count = 0 |
|
A transformation's output specification must support this new notation, which may contain variables. For example:
| {noun} {has_have} {number} {noun} -> $1 has(count:$3) $4 |
|
A secondary objective is to ensure that entities can have not only properties, but properties of properties. For example:
Test casesClick hereSolutionClick hereWeb UIClick here
SpeakingSeptember 6, 2008
Although I haven't put much thought into the
language out problem (transforming ideas into written statements), something occurred to me today: Any time a person, or an AI, goes to say something, they have the opportunity to try and parse what they're about to say using their
language in layer. If the resulting meaning is the same or similar enough to the idea they were trying to express, they have the green light to go ahead and speak. Otherwise, the speaker needs to go back to the drawing board and figure out how else to express their idea.
older >>