intfiction.org

The Interactive Fiction Community Forum
It is currently Sat Feb 23, 2019 4:56 am

All times are UTC - 6 hours [ DST ]




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: Articles of values
PostPosted: Thu Feb 07, 2019 2:52 pm 
Offline

Joined: Sat Feb 13, 2016 6:26 pm
Posts: 168
Two questions about values and articles:

1. Article output for values

How do we get the right [a/an] indefinite article for a value, as in:

Code:
A picture is a kind of value. The pictures are landscape, portrait, abstract, nude, still life, and blank.

... say "You have already drawn [a picture of the second noun] on [the second noun]." instead.


"[a picture of the second noun]" basically gives the value without any articles, as in:

Quote:
>draw landscape on canvas
You have already drawn nude on the large canvas.


I got to this solution, but I am open for more suggestions:

Code:
A picture is a kind of value. The pictures are landscape, portrait, abstract, nude, still life, and blank.

A picture has some text called ind-article. The ind-article of a picture is usually "a". The ind-article for abstract is "an".

A picture has some text called def-article. The def-article of a picture is usually "the".


2. Article input for values

For an action applying to a value, the parser does not seem to understand an article before the value. Am I suppose to provide articles in the "understand" parts of the action definition? Example:

Code:
A picture is a kind of value. The pictures are landscape, portrait, abstract, nude, still life, and blank.

Drawing it on is an action applying to one picture and one thing. Understand "draw a/an/the/-- [picture] on [something]" or "sketch a/an/the/-- [picture] on [something]" as drawing it on.


Thanks


Top
 Profile Send private message  
Reply with quote  
 Post subject: Re: Articles of values
PostPosted: Fri Feb 08, 2019 4:25 pm 
Offline
User avatar

Joined: Fri Aug 14, 2009 10:01 pm
Posts: 22
Something I've done in a semi-similar situation is to define the 'property' instead as (off-stage) things, and then use relationships. I don't know if it'd work in your case but you could play around with it. One limitation I've found in my case is that then I can't (or haven't yet found a way) to understand that relationship as the thing, in the way you can understand a property as a thing.


Top
 Profile Send private message  
Reply with quote  
 Post subject: Re: Articles of values
PostPosted: Fri Feb 08, 2019 6:06 pm 
Offline

Joined: Tue Mar 09, 2010 2:34 pm
Posts: 5568
Location: Burlington, VT
You can understand things by their relationships--check out §17.16 of Writing with Inform.

For the original thing, you can define a custom phrase to do it:

Code:
Studio is a room.

A picture is a kind of value. The pictures are landscape, portrait, abstract, nude, still life, and blank.

A canvas is in the Studio. The canvas has a picture. The picture of the canvas is blank.

Drawing is an action applying to one picture. Understand "draw [picture]" as drawing.

Instead of drawing:
   if the picture understood is blank:
      say "When you try to think of how to do that, you draw a blank.";
   otherwise if the picture of the canvas is not blank:
      say "You have already drawn [a picture of the canvas] on the canvas." ;
   otherwise:
      say "You draw [a picture understood] on the canvas.";
      now the picture of the canvas is the picture understood.
      
To say a (image - a picture):
   if the image is abstract:
      say "an [image]";
   otherwise:
      say "a [image]".


This code is all kinds of mess, for instance you'd want to break the Instead up into a few separate rules probably, and you may want to test whether the first letter of the image is a vowel rather than just hand-coding in the one that starts with a vowel... but hopefully the critical part is clear enough.


Top
 Profile Send private message  
Reply with quote  
 Post subject: Re: Articles of values
PostPosted: Fri Feb 08, 2019 6:40 pm 
Offline
User avatar

Joined: Fri Aug 14, 2009 10:01 pm
Posts: 22
Quote:
You can understand things by their relationships--check out §17.16 of Writing with Inform.


...You mean the chapter helpfully entitled "Understanding things by their relations"? Where's a head-slap smiley when you need one? Thank you!


Top
 Profile Send private message  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC - 6 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 15 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group