Author Topic: Parsing Noun/Qualifying Adjective Words  (Read 7548 times)

0 Members and 1 Guest are viewing this topic.

Offline NilG

Parsing Noun/Qualifying Adjective Words
« on: April 04, 2019, 05:07:45 PM »
I encountered something that seemed interesting to me while testing out some of the responses I get to certain inputs, and while I sort of see the reason behind the response, I'm not sure what the reason behind the reason for the response is.   :)

So among multiple look statements, there's one that pretty straightforward:

Code: [Select]
(if (Said '/car,shuttle')
car works fine.  shuttle, however, just prints the basic room response.  After looking a bit, I see this is because "shuttle" is both a noun and a qualifying adjective.  If I remove the "adjective" attribute, it works.

I'd set it as an adjective because you can look at the shuttle door, for example, to differentiate it from looking at a different door.  From what I can tell, things are still working in that regard with shuttle just set to "noun," so all good (I think!).

But now I'm wondering, as I have a few other nouns I've also made qualifying adjectives for similar reasons, could that be problematic down the line?  Do nouns function as qualifying adjectives when used in that way within the said statement?  Is there a reason, in the above example, that 'shuttle' would be taken to be an adjective instead of a noun when there's nothing following it?  'look AT shuttle' works like I'd expect, but 'look shuttle' doesn't.

I've reviewed a few of the pages around here and may have missed it, but haven't seen anything specific to this.  I feel like the word type associations can be fickle, and have had to play around with them in a few places to get things to work for similar reasons.  It always seems to be ultimately manageable, I was just wondering if anyone know why it interprets things in these ways, treating a word like an adjective when it's also a noun and there's nothing else for it to qualify in the input?



Offline troflip

Re: Parsing Noun/Qualifying Adjective Words
« Reply #1 on: April 04, 2019, 05:42:12 PM »
Well, shuttle isn't an adjective in the English language. But nouns can act as adjectives, and the SCI parser understands that.

In other words:
'look/door' will match "look shuttle door". Or in fact any "look [anynoun] door".

If you want to specifically match shuttle door, you can do:
'look/door<shuttle'. This will match "look shuttle door" but not "look door", or "look [anynoun] door".

If you want to match "shuttle door" or "door" but not anything else, you can do:
'look/door[<!*,shuttle]'

So there doesn't seem to be any reason to make it an adjective. Although something like
'look/shuttle' should work just fine (i.e. match "look shuttle") if it's both a noun and adjective. Is that not happening for you?

Check out my website: http://icefallgames.com
Groundhog Day Competition

Offline NilG

Re: Parsing Noun/Qualifying Adjective Words
« Reply #2 on: April 04, 2019, 05:52:13 PM »
Okay, nice.  It is working as expected when I just leave shuttle as a noun and don't set it also as an adjective.  I was just seeing strange behavior otherwise (shuttle set to both) where 'look/shuttle' was skipping over the expected response, seemingly because it was treating shuttle as an adjective rather than a noun.

Either way, though, if the parser's smart enough to use a noun as an adjective when appropriate, that's more than good enough for sure.

Offline troflip

Re: Parsing Noun/Qualifying Adjective Words
« Reply #3 on: April 04, 2019, 06:11:16 PM »
Either way, though, if the parser's smart enough to use a noun as an adjective when appropriate, that's more than good enough for sure.

It's really defined in the grammar that's in vocab.994 (I think?). Sierra generated that resource based on a grammar text file that you could potentially edit. But I don't know if anyone has those tools (or the original grammar file)... I looked quickly on omermor's github repos and didn't see anything.
Check out my website: http://icefallgames.com
Groundhog Day Competition

Offline OmerMor

Re: Parsing Noun/Qualifying Adjective Words
« Reply #4 on: April 05, 2019, 02:24:28 AM »
I only found some fragments:
Code: (GC.BAT) [Select]
echo off
echo GC: Grammar Compiler version 0.001
echo for use by authorized Sierra programmers only
echo requires MASM assembler
echo -
echo compiling Parser grammar grammar.txt to vocab.900...

masm -ml -s -t -z -w2 grammar.txt,grammar.o > gc.log;
link grammar.o; >> gc.log
exe2bin grammar vocab.900 >> gc.log
del grammar.o >> gc.log
del grammar.exe >> gc.log

echo done.
echo here is the log file gc.log:
more < gc.log

Code: (GRAMMAR.TXT from 1988) [Select]
INCLUDE nlsyms.txt

_DATA segment

org 0

;;;
;;; Mark as a VOCAB file
;;;

db 86h,0

;;;
;;; Here comes the Parser NL Grammar
;;;

dw NLS,     NLROOT,NLVP,    NULL,NULL,      NULL,NULL,       NULL,NULL,NULL

;;;
;;;******************* VP *******************
;;;

;shoot
dw NLVP,    NLROOT,NLCVERB, NULL  ,NULL,    NULL,NULL,       NULL,NULL,NULL

;put board down
dw NLVP,    NLROOT,NLCVERB, NLDOBJ,NLNP,    NLMOD,NLPREP,    NULL,NULL,NULL

;hit board lightly
dw NLVP,    NLROOT,NLCVERB, NLDOBJ,NLNP,    NLMOD,NLADV,     NULL,NULL,NULL

;talk dwarf
dw NLVP,    NLROOT,NLCVERB, NLDOBJ,NLNP,    NULL,NULL,       NULL,NULL,NULL

;talk to dwarf: DO=dwarf
dw NLVP,    NLROOT,NLCVERB, NLDOBJ,NLAP,    NULL,NULL,       NULL,NULL,NULL

;give gold to dwarf:  DO=gold IO=dwarf
dw NLVP,    NLROOT,NLCVERB, NLDOBJ,NLNP,    NLIOBJ,NLAP,     NULL,NULL,NULL

;give dwarf the gold: IO=dwarf DO=gold (same as above)
dw NLVP,    NLROOT,NLCVERB, NLIOBJ,NLNP,    NLDOBJ,NLNP,     NULL,NULL,NULL

;burger
dw NLVP,    NLDOBJ,NLNP,    NULL  ,NULL,    NULL,NULL,       NULL,NULL,NULL

;burger with fries
dw NLVP,    NLDOBJ,NLNP,    NLIOBJ,NLAP,    NULL,NULL,       NULL,NULL,NULL

; WITH FRIES or IN THE TRUNK
;dw NLVP,    NLIOBJ,NLAP,    NULL,NULL,      NULL,NULL,       NULL,NULL,NULL

;???
;dw NLVP,    NLMOD ,NLCVERB, NLROOT,NLVP,    NULL,NULL,       NULL,NULL,NULL

;;;
;;;******************* NP *******************
;;;
;the book
dw NLNP,    NLIGNR,NLART,   NLROOT,NLCNOUN, NULL,NULL,       NULL,NULL,NULL
;the red book
dw NLNP,    NLIGNR,NLART,   NLMOD ,NLCADJ,  NLROOT,NLCNOUN,  NULL,NULL,NULL
;red book
dw NLNP,    NLMOD ,NLCADJ,  NLROOT,NLCNOUN, NULL,NULL,       NULL,NULL,NULL

;red
dw NLNP,    NLROOT,NLCADJ,  NULL,NULL,      NULL,NULL,       NULL,NULL,NULL

;book
dw NLNP,    NLROOT,NLCNOUN, NULL,NULL,      NULL,NULL,       NULL,NULL,NULL

;???
;dw NLNP,    NLROOT,NLCNOUN, NLMOD,NLASS,    NLMOD,NLNP,      NULL,NULL,NULL
;???
;dw NLNP,    NLIGNR,NLASS,   NLROOT,NLNP,    NULL,NULL,       NULL,NULL,NULL

;;;
;;;******************* AP *******************
;;;

;put rock UNDER BRIDGE
dw NLAP,    NLMOD ,NLPREP,  NLROOT,NLNP,    NULL,NULL,       NULL,NULL,NULL
;give book TO DWARF
dw NLAP,    NLMOD ,NLASS,   NLROOT,NLNP,    NULL,NULL,       NULL,NULL,NULL
;ask maid TO DO THE BED
dw NLAP,    NLMOD ,NLASS,   NLROOT,NLAUXV,  NLMOD ,NLNP,     NULL,NULL,NULL
;ask child TO BE QUIET
dw NLAP,    NLMOD ,NLASS,   NLROOT,NLAUXV,  NLMOD ,NLADJ,    NULL,NULL,NULL
;"sleep" in "do fairies sleep" spec: 'do/fairies/sleep'
dw NLAP,    NLROOT,NLCVERB, NULL  ,NULL,    NULL,NULL,       NULL,NULL,NULL
;say the body IS IN THE TRUNK
dw NLAP,    NLMOD,NLCVERB,  NLROOT,NLAP,    NULL,NULL,       NULL,NULL,NULL

;???
;dw NLAP,    NLROOT,NLNP,    NULL  ,NULL,    NULL,NULL,       NULL,NULL,NULL
;dw NLAP,    NLROOT,NLVP,    NULL  ,NULL,    NULL,NULL,       NULL,NULL,NULL

;;;
;;;******************* CNOUN *******************
;;;

;bow and arrows
dw NLCNOUN, NLROOT,NLNOUN,  NLIGNR,NLCONJ,  NLROOT,NLCNOUN,  NULL,NULL,NULL
;prison guard jacket
dw NLCNOUN, NLMOD ,NLNOUN,  NLROOT,NLCNOUN, NULL,NULL,       NULL,NULL,NULL
;jacket
dw NLCNOUN, NLROOT,NLNOUN,  NULL,NULL,      NULL,NULL,       NULL,NULL,NULL

;;;
;;;******************* CVERB *******************
;;;

;go swim
dw NLCVERB, NLMOD ,NLAUXV,  NLROOT,NLCVERB, NULL,NULL,       NULL,NULL,NULL

;did you see
dw NLCVERB, NLMOD ,NLAUXV,  NLMOD ,NLNOUN,  NLROOT,NLCVERB,  NULL,NULL,NULL

;put
dw NLCVERB, NLROOT,NLVERB,  NULL,NULL,      NULL,NULL,       NULL,NULL,NULL

;put down
dw NLCVERB, NLROOT,NLVERB,  NLMOD ,NLPREP,  NULL,NULL,       NULL,NULL,NULL

;lie down on
dw NLCVERB, NLROOT,NLVERB,  NLMOD ,NLPREP,  NLMOD ,NLPREP,   NULL,NULL,NULL

;swim quickly
dw NLCVERB, NLROOT,NLVERB,  NLMOD ,NLADV,   NULL,NULL,       NULL,NULL,NULL

;HOW MUCH IS dinner : 'is<much<how/dinner'
dw NLCVERB, NLMOD ,NLADV,   NLMOD ,NLADV,   NLROOT,NLCVERB,  NULL,NULL,NULL

;soundly sleep
;what did you see
dw NLCVERB, NLMOD ,NLADV,   NLROOT,NLCVERB, NULL,NULL,       NULL,NULL,NULL

;how
dw NLCVERB, NLROOT,NLADV,   NULL,NULL,      NULL,NULL,       NULL,NULL,NULL

;"what time is" in "what time is it" spec: 'is<what<time'
dw NLCVERB, NLMOD ,NLADV,   NLMOD ,NLNOUN,  NLROOT,NLCVERB,  NULL,NULL,NULL

;do fairies sleep
;dw NLCVERB, NLMOD ,NLVERB,  NLMOD ,NLNOUN,  NLROOT,NLCVERB,  NULL,NULL,NULL

;;;
;;;******************* CADJ *******************
;;;

;green
dw NLCADJ,  NLROOT,NLADJ,   NULL,NULL,      NULL,NULL,       NULL,NULL,NULL
;dark green
dw NLCADJ,  NLMOD ,NLADJ,   NLROOT,NLCADJ,  NULL,NULL,       NULL,NULL,NULL

;;;
;;;******************* VOCAB POINTERS *******************
;;;

dw NLADV,   NLVOCAB,ADV,    NULL,NULL,      NULL,NULL,       NULL,NULL,NULL
dw NLVERB,  NLVOCAB,VERB,   NULL,NULL,      NULL,NULL,       NULL,NULL,NULL
dw NLVERB,  NLVOCAB,AUXV,   NULL,NULL,      NULL,NULL,       NULL,NULL,NULL
dw NLAUXV,  NLVOCAB,AUXV,   NULL,NULL,      NULL,NULL,       NULL,NULL,NULL
dw NLNOUN,  NLVOCAB,NOUN,   NULL,NULL,      NULL,NULL,       NULL,NULL,NULL
dw NLPRON,  NLVOCAB,PRON,   NULL,NULL,      NULL,NULL,       NULL,NULL,NULL
dw NLADJ,   NLVOCAB,ADJ,    NULL,NULL,      NULL,NULL,       NULL,NULL,NULL
dw NLART,   NLVOCAB,ART,    NULL,NULL,      NULL,NULL,       NULL,NULL,NULL
dw NLPREP,  NLVOCAB,POS,    NULL,NULL,      NULL,NULL,       NULL,NULL,NULL
dw NLASS,   NLVOCAB,ASS,    NULL,NULL,      NULL,NULL,       NULL,NULL,NULL
dw NLCONJ,  NLVOCAB,CONJ,   NULL,NULL,      NULL,NULL,       NULL,NULL,NULL

dw NULL,    NULL,NULL,      NULL,NULL,      NULL,NULL,       NULL,NULL,NULL


_DATA ends
end

Code: (GRAMMAR.TXT from 1989) [Select]
INCLUDE nlsyms.txt

_DATA segment

org 0

;;;
;;; Mark as a VOCAB file
;;;

db 86h,0

;;;
;;; Here comes the Parser NL Grammar
;;;

dw NLS,     NLROOT,NLVP,    NULL,NULL,      NULL,NULL,       NULL,NULL,NULL

;;;
;;;******************* VP *******************
;;;

;shoot
dw NLVP,    NLROOT,NLCVERB, NULL  ,NULL,    NULL,NULL,       NULL,NULL,NULL

;put board down = put<down/board
dw NLVP,    NLROOT,NLCVERB, NLDOBJ,NLNP,    NLMOD,NLPREP,    NULL,NULL,NULL

;color the paper red
dw NLVP,    NLROOT,NLCVERB, NLDOBJ,NLNP,    NLMOD,NLCADJ,    NULL,NULL,NULL

;hit board lightly
dw NLVP,    NLROOT,NLCVERB, NLDOBJ,NLNP,    NLMOD,NLADV,     NULL,NULL,NULL

;talk to dwarf
;put down board = put<down/board
dw NLVP,    NLROOT,NLCVERB, NLDOBJ,NLNP,    NULL,NULL,       NULL,NULL,NULL

;give gold to dwarf =  'give<to/gold/dwarf'
;put rock under bridge = 'put<under/rock/bridge'
dw NLVP,    NLROOT,NLCVERB, NLDOBJ,NLNP,    NLMOD,NLPREP,  NLIOBJ,NLNP,NULL

;give dwarf the gold: IO=dwarf DO=gold (same as above) 'give/gold/dwarf'
dw NLVP,    NLROOT,NLCVERB, NLIOBJ,NLNP,    NLDOBJ,NLNP,     NULL,NULL,NULL

;talk to dwarf about gold: talk<to/dwarf/gold<about
dw NLVP,    NLROOT,NLCVERB, NLDOBJ,NLNP,    NLIOBJ,NLAP,     NULL,NULL,NULL

;talk about gold = 'talk//gold<about'
dw NLVP,    NLROOT,NLCVERB, NLIOBJ,NLAP,    NULL,NULL,       NULL,NULL,NULL

;burger = '/burger'
;john is SORRY
dw NLVP,    NLDOBJ,NLNP,    NULL  ,NULL,    NULL,NULL,       NULL,NULL,NULL

;burger with fries = '/burger/fries
dw NLVP,    NLDOBJ,NLNP,    NLIOBJ,NLAP,    NULL,NULL,       NULL,NULL,NULL

;*** this doesn't work, phrase MUST have a root or SCI bombs ***
; WITH FRIES or IN THE TRUNK
;dw NLVP,    NLIOBJ,NLAP,    NULL,NULL,      NULL,NULL,       NULL,NULL,NULL

;TELL THE MAN TO give the gold to the dwarf = 'give<TELL<MAN<TO/gold/dwarf'
dw NLVP,    NLMOD ,NLCVERB, NLMOD,NLNP,     NLMOD ,NLPREP,   NLROOT,NLVP,NULL

;the tall clerk is the killer: 'is<(clerk<tall)/killer'
;john is sorry = is<john/sorry
dw NLVP,    NLMOD,NLNP,     NLROOT,NLVP,    NULL,NULL,       NULL,NULL,NULL

;;;
;;;******************* NP *******************
;;;

;the book
dw NLNP,    NLIGNR,NLART,   NLROOT,NLCNOUN, NULL,NULL,       NULL,NULL,NULL

;the red book
dw NLNP,    NLIGNR,NLART,   NLMOD ,NLCADJ,  NLROOT,NLCNOUN,  NULL,NULL,NULL

;red book
dw NLNP,    NLMOD ,NLCADJ,  NLROOT,NLCNOUN, NULL,NULL,       NULL,NULL,NULL

;red
dw NLNP,    NLROOT,NLCADJ,  NULL,NULL,      NULL,NULL,       NULL,NULL,NULL

;book
dw NLNP,    NLROOT,NLCNOUN, NULL,NULL,      NULL,NULL,       NULL,NULL,NULL


;;;
;;;******************* AP *******************
;;;

;put rock UNDER BRIDGE - OBSOLETE CLAUSE
;dw NLAP,    NLMOD ,NLPREP,  NLROOT,NLNP,    NULL,NULL,       NULL,NULL,NULL

;give book TO DWARF
;chop tree WITH AX
dw NLAP,    NLMOD ,NLASS,   NLROOT,NLNP,    NULL,NULL,       NULL,NULL,NULL

;chop tree USING AX
dw NLAP,    NLMOD ,NLAUXV,  NLROOT,NLNP,    NULL,NULL,       NULL,NULL,NULL

;ask maid TO DO THE BED
dw NLAP,    NLMOD ,NLASS,   NLROOT,NLAUXV,  NLMOD ,NLNP,     NULL,NULL,NULL

;ask child TO BE QUIET
dw NLAP,    NLMOD ,NLASS,   NLROOT,NLAUXV,  NLMOD ,NLADJ,    NULL,NULL,NULL

;"sleep" in "do fairies sleep" spec: 'do/fairies/sleep'
dw NLAP,    NLROOT,NLCVERB, NULL  ,NULL,    NULL,NULL,       NULL,NULL,NULL

;say the body IS IN THE TRUNK
dw NLAP,    NLMOD,NLCVERB,  NLROOT,NLAP,    NULL,NULL,       NULL,NULL,NULL

;ask ABOUT SYMBOL OF MITHRA = ask//symbol<about<symbol<of
;("of" is a positional PREPosition)
dw NLAP,    NLMOD ,NLASS,   NLROOT,NLNP,    NLMOD,NLPREP,    NLMOD,NLNP,NULL

;???
;dw NLAP,    NLROOT,NLNP,    NULL  ,NULL,    NULL,NULL,       NULL,NULL,NULL
;dw NLAP,    NLROOT,NLVP,    NULL  ,NULL,    NULL,NULL,       NULL,NULL,NULL

;;;
;;;******************* CNOUN *******************
;;;

;bow and arrows
;door of the crypt
dw NLCNOUN, NLROOT,NLNOUN,  NLIGNR,NLCONJ,  NLROOT,NLNP,     NULL,NULL,NULL

;prison guard jacket
dw NLCNOUN, NLMOD ,NLNOUN,  NLROOT,NLCNOUN, NULL,NULL,       NULL,NULL,NULL

;jacket
dw NLCNOUN, NLROOT,NLNOUN,  NULL,NULL,      NULL,NULL,       NULL,NULL,NULL

;;;
;;;******************* CVERB *******************
;;;

;go swim
dw NLCVERB, NLMOD ,NLAUXV,  NLROOT,NLCVERB, NULL,NULL,       NULL,NULL,NULL

;did you see?
;do zombies sleep?
dw NLCVERB, NLMOD ,NLAUXV,  NLMOD ,NLNOUN,  NLROOT,NLCVERB,  NULL,NULL,NULL

;john IS sorry
dw NLCVERB, NLROOT,NLAUXV,  NULL,NULL,      NULL,NULL,       NULL,NULL,NULL

;go to swim
dw NLCVERB, NLMOD,NLAUXV,   NLMOD,NLPREP,   NLROOT,NLVERB,   NULL,NULL,NULL

;go down to swim
dw NLCVERB, NLMOD,NLAUXV,  NLMOD,NLPREP,  NLMOD,NLPREP,  NLROOT,NLVERB,NULL

;put
dw NLCVERB, NLROOT,NLVERB,  NULL,NULL,      NULL,NULL,       NULL,NULL,NULL

;put down
dw NLCVERB, NLROOT,NLVERB,  NLMOD ,NLPREP,  NULL,NULL,       NULL,NULL,NULL

;lie down on
dw NLCVERB, NLROOT,NLVERB,  NLMOD ,NLPREP,  NLMOD ,NLPREP,   NULL,NULL,NULL

;COLOR BRIGHT RED the paper
dw NLCVERB, NLROOT,NLVERB,  NLMOD ,NLCADJ,  NULL,NULL,       NULL,NULL,NULL

;swim quickly
dw NLCVERB, NLROOT,NLVERB,  NLMOD ,NLADV,   NULL,NULL,       NULL,NULL,NULL

;HOW MUCH IS dinner : 'is<much<how/dinner'
dw NLCVERB, NLMOD ,NLADV,   NLMOD ,NLADV,   NLROOT,NLCVERB,  NULL,NULL,NULL

;soundly sleep
;what did you see
dw NLCVERB, NLMOD ,NLADV,   NLROOT,NLCVERB, NULL,NULL,       NULL,NULL,NULL

;how
dw NLCVERB, NLROOT,NLADV,   NULL,NULL,      NULL,NULL,       NULL,NULL,NULL

;"what time is" in "what time is it" spec: 'is<what<time'
dw NLCVERB, NLMOD ,NLADV,   NLMOD ,NLNOUN,  NLROOT,NLCVERB,  NULL,NULL,NULL

;look and feel
dw NLCVERB, NLROOT,NLVERB,  NLIGNR,NLCONJ,  NLROOT,NLVERB,   NULL,NULL,NULL

;look, listen and feel
dw NLCVERB,  NLROOT,NLVERB,  NLROOT,NLVERB,  NLIGNR,NLCONJ,   NLROOT,NLVERB,NULL

;;;
;;;******************* CADJ *******************
;;;

;green
dw NLCADJ,  NLROOT,NLADJ,   NULL,NULL,      NULL,NULL,       NULL,NULL,NULL
;dark green
dw NLCADJ,  NLMOD ,NLADJ,   NLROOT,NLCADJ,  NULL,NULL,       NULL,NULL,NULL

;;;
;;;******************* VOCAB POINTERS *******************
;;;

dw NLADV,   NLVOCAB,ADV,    NULL,NULL,      NULL,NULL,       NULL,NULL,NULL
dw NLVERB,  NLVOCAB,VERB,   NULL,NULL,      NULL,NULL,       NULL,NULL,NULL
dw NLVERB,  NLVOCAB,AUXV,   NULL,NULL,      NULL,NULL,       NULL,NULL,NULL
dw NLAUXV,  NLVOCAB,AUXV,   NULL,NULL,      NULL,NULL,       NULL,NULL,NULL
dw NLNOUN,  NLVOCAB,NOUN,   NULL,NULL,      NULL,NULL,       NULL,NULL,NULL
dw NLPRON,  NLVOCAB,PRON,   NULL,NULL,      NULL,NULL,       NULL,NULL,NULL
dw NLADJ,   NLVOCAB,ADJ,    NULL,NULL,      NULL,NULL,       NULL,NULL,NULL
dw NLART,   NLVOCAB,ART,    NULL,NULL,      NULL,NULL,       NULL,NULL,NULL
dw NLPREP,  NLVOCAB,POS,    NULL,NULL,      NULL,NULL,       NULL,NULL,NULL
dw NLASS,   NLVOCAB,ASS,    NULL,NULL,      NULL,NULL,       NULL,NULL,NULL
dw NLCONJ,  NLVOCAB,CONJ,   NULL,NULL,      NULL,NULL,       NULL,NULL,NULL

dw NULL,    NULL,NULL,      NULL,NULL,      NULL,NULL,       NULL,NULL,NULL


_DATA ends
end

Code: (GRAMMAR.TXT from 1990) [Select]
(S (ROOT VP))

;;;
;;;******************* VP *******************
;;;

;shoot
(VP (ROOT CVERB))

;put board down = put<down/board
(VP (ROOT CVERB) (DOBJ NP) (MOD POS))

;color the paper red
(VP (ROOT CVERB) (DOBJ NP) (MOD CADJ))

;hit board lightly
(VP (ROOT CVERB) (DOBJ NP) (MOD ADV))

;talk to dwarf
;put down board = put<down/board
(VP (ROOT CVERB) (DOBJ NP))

;give gold to dwarf = 'give<to/gold/dwarf'
;put rock under bridge = 'put<under/rock/bridge'
(VP (ROOT CVERB) (DOBJ NP) (MOD POS) (IOBJ NP))

;give dwarf the gold: IO=dwarf DO=gold (same as above)'give/gold/dwarf'
(VP (ROOT CVERB) (IOBJ NP) (DOBJ NP))

;talk to dwarf about gold: talk<to/dwarf/gold<about
(VP (ROOT CVERB) (DOBJ NP) (IOBJ AP))

;talk about gold = 'talk//gold<about'
(VP (ROOT CVERB) (IOBJ AP))

;burger = '/burger'
;john is SORRY
(VP (DOBJ NP))

;burger with fries = '/burger/fries
(VP (DOBJ NP) (IOBJ AP))

;*** this doesn't work phrase MUST have a root or SCI bombs ***
; WITH FRIES or IN THE TRUNK
;(VP (IOBJ AP))

;TELL THE MAN TO give the gold to the dwarf = 'give<TELL<MAN<TO/gold/dwarf'
(VP (MOD CVERB) (MOD NP) (MOD POS) (ROOT VP))

;the tall clerk is the killer: 'is<(clerk<tall)/killer'
;john is sorry = is<john/sorry
(VP (MOD NP) (ROOT VP))

;bargain with man about map
(VP (ROOT CVERB) (IOBJ AP) (DOBJ AP))
(VP (ROOT CVERB) (DOBJ AP) (IOBJ AP))

;;;
;;;******************* NP *******************
;;;

;the book
(NP (IGNR ART) (ROOT CNOUN))

;the red book
(NP (IGNR ART) (MOD CADJ) (ROOT CNOUN))

;red book
(NP (MOD CADJ) (ROOT CNOUN))

;red
(NP (ROOT CADJ))

;book
(NP (ROOT CNOUN))


;;;
;;;******************* AP *******************
;;;

;put rock UNDER BRIDGE - OBSOLETE CLAUSE
;(AP (MOD POS) (ROOT NP))

;give book TO DWARF
;chop tree WITH AX
(AP (MOD ASS) (ROOT NP))

;chop tree USING AX
(AP (MOD AUXV) (ROOT NP))

;ask maid TO DO THE BED
(AP (MOD ASS) (ROOT AUXV) (MOD NP))

;ask child TO BE QUIET
(AP (MOD ASS) (ROOT AUXV) (MOD ADJ))

;"sleep" in "do fairies sleep" spec: 'do/fairies/sleep'
(AP (ROOT CVERB))

;say the body IS IN THE TRUNK
(AP (MOD CVERB) (ROOT AP))

;ask ABOUT SYMBOL OF MITHRA = ask//symbol<about<symbol<of
;("of" is a positional preposition)
(AP (MOD ASS) (ROOT NP) (MOD POS) (MOD NP))

;???
;(AP (ROOT NP))
;(AP (ROOT VP))

;;;
;;;******************* CNOUN *******************
;;;

;bow and arrows
;door of the crypt
(CNOUN (ROOT NOUN) (IGNR CONJ) (ROOT NP))

;prison guard jacket
(CNOUN (MOD NOUN) (ROOT CNOUN))

;jacket
(CNOUN (ROOT NOUN))

;;;
;;;******************* CVERB *******************
;;;

;go swim
(CVERB (MOD AUXV) (ROOT CVERB))

;did you see?
;do zombies sleep?
;(CVERB (MOD AUXV) (MOD NOUN) (ROOT CVERB))
(CVERB (MOD AUXV) (MOD NP) (ROOT CVERB))

;USE SWORD TO CUT the tree = cut<use<sword<to/tree
(CVERB (MOD AUXV) (MOD NP) (MOD POS) (ROOT CVERB))

;john IS sorry
(CVERB (ROOT AUXV))

;go to swim
(CVERB (MOD AUXV) (MOD POS) (ROOT VERB))

;go down to swim
(CVERB (MOD AUXV) (MOD POS) (MOD POS) (ROOT VERB))

;put
(CVERB (ROOT VERB))

;put down
(CVERB (ROOT VERB) (MOD POS))

;lie down on
(CVERB (ROOT VERB) (MOD POS) (MOD POS))
(CVERB (ROOT VERB) (MOD ADV) (MOD POS))

;COLOR BRIGHT RED the paper
(CVERB (ROOT VERB) (MOD CADJ))

;swim quickly
(CVERB (ROOT VERB) (MOD ADV))

;HOW MUCH IS dinner : 'is<much<how/dinner'
(CVERB (MOD ADV) (MOD ADV) (ROOT CVERB))

;soundly sleep
;what did you see
(CVERB (MOD ADV) (ROOT CVERB))

;how
(CVERB (ROOT ADV))

;"what time is" in "what time is it" spec: 'is<what<time'
(CVERB (MOD ADV) (MOD NOUN) (ROOT CVERB))

;look and feel
(CVERB (ROOT VERB) (IGNR CONJ) (ROOT VERB))

;look listen and feel
(CVERB (ROOT VERB) (ROOT VERB) (IGNR CONJ) (ROOT VERB))

;;;THIS IS A TEST FOR "I AM SORRY" --Pablo for Brian
;(CVERB (MOD NP) (ROOT CVERB))

;;;
;;;******************* CADJ *******************
;;;

;green
(CADJ (ROOT ADJ))
;dark green
(CADJ (MOD ADJ) (ROOT CADJ))

;;;
;;;******************* (VOCAB POINTERS *******************
;;;

(ADV  (VOCAB KADV))
(VERB (VOCAB KVERB))
(VERB (VOCAB KAUXV))
(AUXV (VOCAB KAUXV))
(NOUN (VOCAB KNOUN))
(PRON (VOCAB KPRON))
(ADJ  (VOCAB KADJ))
(ART  (VOCAB KART))
(POS  (VOCAB KPOS))
(ASS  (VOCAB KASS))
(CONJ (VOCAB KCONJ))

Code: (NLSYMS.TXT) [Select]
NULL     equ 0

;;;
;;; the following should be in sync
;;; NLSYMS.H
;;;
MINNLTOKEN equ 300
;NLRP    equ 301
;NLLP    equ 302
NLVERB  equ 303
NLNOUN  equ 304
NLART   equ 305
NLADJ   equ 306
NLPREP  equ 307
NLPRON  equ 308
NLCONJ  equ 309
NLAUXV  equ 310
NLADV   equ 311
NLASS   equ 312
NLCNOUN equ 313
NLCADJ  equ 314
NLCVERB equ 315
NLVP    equ 316
NLNP    equ 317
NLAP    equ 318
NLS     equ 319
NLEOL   equ 320
NLROOT  equ 321
NLDOBJ  equ 322
NLIOBJ  equ 323
NLMOD   equ 324
NLIGNR  equ 325
NLVOCAB equ 326
NLSPEC  equ 327
NLSPEC2 equ 328
NLPHR   equ 329
NLPHR2  equ 330
NLMORE  equ 331
NLUNIT  equ 332
NLPNCT  equ 333
NLEMPT  equ 334
NLOR    equ 335
NLOR2   equ 336
NLATOM  equ 337
NLOPT   equ 338
NLWORD  equ 339
NLPUT   equ 340
NLNUM   equ 341
EOGRAMMAR  equ 342
MAXNLTOKEN equ 343

;;;
;;; the following should be in sync
;;; VOCAB.H
;;;
VERB        equ 800h ;2048
ADV         equ 400h ;1024
AUXV        equ 200h ;0512
NOUN        equ 100h ;0256
PRON        equ 080h ;0128
ADJ         equ 040h ;0064
ART         equ 020h ;0032
POS         equ 010h ;0016
ASS         equ 008h ;0008
CONJ        equ 004h ;0004

ORSAID      equ 0f0h ;240
ANDSAID     equ 0f1h ;241
NEXTPART    equ 0f2h ;242
LEFTPAREN   equ 0f3h ;243
RIGHTPAREN  equ 0f4h ;244
OPTBEGIN    equ 0f5h ;245
OPTEND      equ 0f6h ;246
NUMBER      equ 0f7h ;247
MODIFIES    equ 0f8h ;248
RUNON       equ 0f9h ;249
METAEND     equ 0ffh ;255

;;;
;;; the following should be in sync
;;; NLSDGRMR.H
;;;
METASHIFT   equ 100h

NLRNON   equ RUNON * METASHIFT
NLLESS   equ MODIFIES * METASHIFT
NLSLSH   equ NEXTPART * METASHIFT
NLLP     equ LEFTPAREN * METASHIFT
NLRP     equ RIGHTPAREN * METASHIFT
NLLB     equ OPTBEGIN * METASHIFT
NLRB     equ OPTEND * METASHIFT
NLCOMA   equ ORSAID * METASHIFT
NLAND    equ ANDSAID * METASHIFT
NLEOSPEC equ METAEND * METASHIFT
NLEND    equ METAEND * METASHIFT


Offline Kawa

Re: Parsing Noun/Qualifying Adjective Words
« Reply #5 on: April 05, 2019, 06:47:37 AM »
So they went from assembly to lisp, huh?

Offline troflip

Re: Parsing Noun/Qualifying Adjective Words
« Reply #6 on: April 05, 2019, 12:25:48 PM »
Yeah, so it looks like the vocab (which I was wrong, it's 900, not 994) is just a straight up dump of the stuff in grammar.txt. You could (tediously) do that manually, or it looks like if you've got the masm.exe, link.exe and exe2bin.exe Sierra tools that would do the job (using the 1988 GRAMMAR.TXT, which is I guess is just straight up asm?). And also assuming you're familiar with Backus-Naur form, which is I guess kind of what the grammar is written in.

I wonder if the localized versions (what did they do? Spanish? German? French?) had different grammar resources...
Check out my website: http://icefallgames.com
Groundhog Day Competition

Offline Kawa

Re: Parsing Noun/Qualifying Adjective Words
« Reply #7 on: April 05, 2019, 03:12:18 PM »
MASM is Microsoft's Macro Assembler, which they also used for the SCI16 (going by archive name) interpreter proper. Not all assemblers are made equal, and the specific syntax won't work on various other assemblers. The alternative from 1990 is Lisp S-Expressions, much like SC script code, not BNF. It'd be trivial to make a grammar compiler that can handle the 1990 version, and I've written a minimal data-only "assembler" for a completely unrelated project years back so I can confirm it'd be trivial to make one for the older grammars too, without the link and exe2bin steps.

Also, going by language.h you missed Italian and Portuguese, I guess.

Edit: I just assembled a vocab.900 myself with MASM (though it's ML here), with only the ASM file as a parameter. I got some linkage warnings, but otherwise I have an OBJ and EXE with the raw data inside. For the OBJ, the raw data started at offset 0x30, offset 0x200 in the EXE. The latter has no trailing bits. From a cursory comparison with a randomly-chosen SCI0 game it seems about right.
« Last Edit: April 05, 2019, 04:31:26 PM by Kawa »

Offline gumby

Re: Parsing Noun/Qualifying Adjective Words
« Reply #8 on: April 06, 2019, 06:51:53 AM »
Some said documentation, might be of some help:

http://sciprogramming.com/tutorial.php?entry=5465
In the Great Underground Empire (Zork port in development)
Winter Break 2012 Rope Prop Competition

Offline Kawa

Re: Parsing Noun/Qualifying Adjective Words
« Reply #9 on: April 06, 2019, 08:21:29 AM »
If I were to make a tool to compile those grammar files, should it be a minisembler for the 80s version or a compiler for the 90s version?

Offline Collector

Re: Parsing Noun/Qualifying Adjective Words
« Reply #10 on: April 06, 2019, 09:40:38 AM »
Both?
KQII Remake Pic

Offline Kawa

Re: Parsing Noun/Qualifying Adjective Words
« Reply #11 on: April 06, 2019, 10:27:50 AM »
I'll just write a general-use minisembler for starters... oops, I already did!


SMF 2.0.19 | SMF © 2021, Simple Machines
Simple Audio Video Embedder

Page created in 0.065 seconds with 23 queries.