I’m writing a Czech translation of TADS 3 and while I’m mostly done, two or three problems still remains in my TODO list and I’m not sure what’s the best approach to solve them.
Thing is, that my language have seven grammatical cases and have little more flexible word ordering than English. It’s not that bad actually, as most verbs have well defined dobj vs. iobj object roles by prepositions. However few actions (ShowTo, GiveTo, ThrowTo, MoveWith, TurnWith, BurnWith, CutWith, CleanWith, (Un)LockWith, (Un)ScrewWith) don’t and player can enter iobj and dobj in either order after a verb. So I’m searching for some possibility to have something like this:
[code]
VerbRule(ShowToType2)
‘show’ (singleIobj dobjList | dobjList singleIobj)
: ShowToAction
verbPhrase = ‘show/showing (what) (to whom)’
askIobjResponseProd = toSingleNoun
/* this is a non-prepositional phrasing */
isPrepositionalPhrasing = nil
;[/code]
This example of course didn’t work, because parser will choose always the first alternative, because it is structuraly OK. Parser do this before it will resolve vocabulary words to objects and before it can take logicalness into account. So when you enter (in Heidi sample game) “show ring burner”, it will reply “You cannot show anything to a diamond ring.” I think that there are two very different kind of solutions:
- Modify parser to understand grammatical cases.
In Czech language even if there si no preposition “to” before iobj, object roles can be distinguished by grammatical case. The words have slightly altered endings to indicate case. So when I say both “ukaz prsten uhlirovi” and “ukaz uhlirovi prsten”, I mean “show ring to burner”. If I would like to errornously say “show burner to ring”, it would be both “ukaz prestenu uhlire” and “ukaz uhlire prstenu”. (Burner is an actor - man burning charcoal.)
That would mean extending dictionary to not only distinguish between adjectives, nouns and so on, but also every grammatical case of each. Then modify parser grammars and do something like:
‘show’ (singleIobj_ToWhomCase dobjList_WhatCase | dobjList_WhatCase singleIobj_ToWhomCase)
This looks like a clean solution to learn parser better understand language, but it has in fact several practical problems:
-
First of all it would be an additional load to an IF author. Now he must specify object name in all grammatical cases and vocabWords in all grammatical cases. This would require adding information which vocabWord is in which case, which will complicate vocabWords format.
-
Grammatical case is distinguished by word ending and when player would use abbreviations it can efectively remove information about case which could lead to hard to explain misunderstanding.
-
Players sometimes seems to underestimate language processing and enter commands which are not much correct from a grammatical standpoint. It is quite common to not decline word into correct case especialy when shortening some verbs to short abbreviations. And as most verbs don’t suffer from this unambiguity, players don’t expect that it sometimes depends on case.
-
There are very few words which are even undistinguishable by grammatical case.
Because of all these problems I was thinking about:
- Let the game try both orderings and pickup the correct one depending on logicalness.
When we talk about ShowTo and GiveTo, iobj must be an actor. So it should be fairly easy to resolve ambiguity. Remaining are little less certain, but in reality I think it shouldn’t be a problem. Or could be? Do you know any situation in which this simplification would do a harm?
And second problem is that I’m really not certain how to implement that behavior. Thank you in advance for any opinions or sugestions.