inventor200
(Joey "Jess" Cramsey)
March 18, 2023, 10:58pm
1
Hey, I am scouring the docs. I hope I’m not being dense again.
First of all: What class is Action.verbRule
? I can’t seem to find it anywhere in the library reference.
Second: Is there a what to check if gAction
needs a singleDobj
, or can accept a multiDobj
?
Basically, I need a way of knowing if an action would ask for disambiguation, or if it would allow for multiple direct objects.
Thank you for your time!
johnnywz00
(John Ziegler)
March 18, 2023, 11:28pm
2
For starters VerbRule is a macro for a grammar statement…
1 Like
inventor200
(Joey "Jess" Cramsey)
March 18, 2023, 11:30pm
3
Right, I’m slowly realizing that, but Examine.verbRule.verbPhrase
evaluates to something, and I’m not sure how…
johnnywz00
(John Ziegler)
March 18, 2023, 11:34pm
4
My bad, I didn’t realize Lite used verbRule as a property…
1 Like
johnnywz00
(John Ziegler)
March 18, 2023, 11:42pm
5
If you can get to the dobjMatch property of the verbRule for the action, it should contain either singleNoun or nounList…
1 Like
inventor200
(Joey "Jess" Cramsey)
March 18, 2023, 11:47pm
6
Lemme try that; will report back momentarily.
johnnywz00
(John Ziegler)
March 18, 2023, 11:49pm
7
As for the class I believe it should be a type of GrammarProd?
inventor200
(Joey "Jess" Cramsey)
March 18, 2023, 11:51pm
8
These are the properties showing up in the reference.
inventor200
(Joey "Jess" Cramsey)
March 18, 2023, 11:55pm
9
Hm… My dev environment is refusing to compile, saying that singleNoun
is “not a property” so it “cannot be used after a period”.
ventilationNode: Room {
roomBeforeAction() {
local a_singleNoun = gAction.verbRule.singleNoun;
if (a_singleNoun == nil) a_singleNoun = 'nil';
local a_nounList = gAction.verbRule.nounList;
if (a_nounList == nil) a_nounList = 'nil';
extraReport('\bsingleNoun: <<a_singleNoun>>\n');
extraReport('nounList: <<a_nounList>>\b');
inherited();
}
}
EDIT: It says the same thing for nounList
… Hm…
inventor200
(Joey "Jess" Cramsey)
March 19, 2023, 12:03am
10
Poking at object.getPropList()
to see if it provides any answers…
EDIT: Nope. Can’t seem to print anything useful to output.
johnnywz00
(John Ziegler)
March 19, 2023, 12:10am
11
The property is dobjMatch…
inventor200
(Joey "Jess" Cramsey)
March 19, 2023, 12:11am
12
John Ziegler:
dobjMatch
Action.verbRule.dobjMatch
?
johnnywz00
(John Ziegler)
March 19, 2023, 12:11am
13
I just can’t remember if it belongs to Prod objects or grammar match tree objects…
johnnywz00
(John Ziegler)
March 19, 2023, 12:12am
14
The grammar for singleDobj has singleNoun being put into the dobjMatch property…
johnnywz00
(John Ziegler)
March 19, 2023, 12:13am
15
Do you have a debugPrint function that uses reflectionServices.valToSymbol?
johnnywz00
(John Ziegler)
March 19, 2023, 12:14am
16
Another check, dobjMatch does belong to the VerbProd so you should be able to access it
inventor200
(Joey "Jess" Cramsey)
March 19, 2023, 12:15am
17
John Ziegler:
singleDobj
John Ziegler:
singleNoun
John Ziegler:
dobjMatch
I don’t understand how these are connected in a way that can be accessed.
John Ziegler:
valToSymbol
I don’t know how to do this. I tried using valToSymbol
earlier, and the environment was like “lolwut”
EDIT: Saw your other reply. Checking VerbProd
next.
johnnywz00
(John Ziegler)
March 19, 2023, 12:18am
18
Have you included reflectionServices? (Re valToSymbol)
inventor200
(Joey "Jess" Cramsey)
March 19, 2023, 12:19am
19
John Ziegler:
valToSymbol
I assume so; I’ve seen Action
code using it earlier…
inventor200
(Joey "Jess" Cramsey)
March 19, 2023, 12:24am
20
Code:
local verbProd = gCommand.verbProd;
"has verbProd: <<(verbProd == nil) ? 'nil' : 'true'>>\n";
local dm = verbProd.dobjMatch;
"has dobjMatch: <<(dm == nil) ? 'nil' : 'true'>>\n";
"dobjMatch: <<dm>>\n";
Output:
has verbProd: true
has dobjMatch: true
dobjMatch: (nounList(nonTerminal))
So if dobjMatch == nounList
, then the Action
allows for multiDobj? Am I understanding this correctly…?
EDIT: Also, sorry, I have no clue how valToSymbol
works, exactly. I remember seeing it used elsewhere, but I’m not familiar with it enough to know how to use it quickly here.
1 Like