intfiction.org

The Interactive Fiction Community Forum
It is currently Sun Jul 22, 2018 11:40 am

All times are UTC - 6 hours [ DST ]




Post new topic Reply to topic  [ 17 posts ]  Go to page Previous  1, 2
Author Message
 Post subject: Re: Articles of a value?
PostPosted: Fri Feb 24, 2012 7:16 pm 
Offline

Joined: Fri Feb 24, 2012 11:44 am
Posts: 14
It only seems to happen on "to say the (c - sayable value)" (lowercase t).

Here's a quick fix:
Code:
To say the (C - sayable value):
   if c is some text:
      say "[c]";
   otherwise:
      say "the [c]";

Obviously this has the limitation that a text property that needs a "the" in front of it won't work. For example:
Code:
A box has some text called the message.
The message of a box is usually "[item described]".

The description of a box is usually "[A material of the item described] cube with the text '[the message of item described]' written on it. [The color of the item described] panels shimmer slightly. [The glow of the item described] glow faintly lights up everything around it."

Will show
Quote:
Welcome
An Interactive Fiction
Release 1 / Serial number 120224 / Inform 7 build 6G60 (I6/v6.32 lib 6/12N) SD

Test room
You can see a Wizard's box and a Sorcerer's box here.

>test me
(Testing.)

>[1] x wizard's box
A wooden cube with the text "Wizard's box" written on it. The blue panels shimmer slightly. The red glow faintly lights up everything around it.

>[2] x sorcerer's box
An iron cube with the text "Sorcerer's box" written on it. The auburn panels shimmer slightly. The red glow faintly lights up everything around it.

>

which doesn't have the extra "the" at the beginning of the sentence, but also doesn't have the desired "the" in the quotes. I think that, for the moment, this is acceptable. But I should probably see if this is in mantis as a bug and report it if not.

--EDIT--
After some more experimenting, I have discovered that it actually happens in examining. The following fully fixes the issue:
Code:
carry out examining something:
   instead say "[description of item described]".

It's obvious that the default rule performs "say "[the description of item described]".", which adds a "the" to the text.

--EDIT--
After more experimenting, I have discovered that it is in standard examining rule.
Code:
The fixed standard examining rule is listed instead of the standard examining rule in the carry out examining rules.
Carry out examining (this is the fixed standard examining rule):
   if the noun provides the property description and the description of the noun is not "":
      say "[description of the noun][line break]";
   now examine text printed is true.

This fixes an issue with the previous work around that prevented the display of "A box is on the pedestal".
As you might be able to guess, in the actual standard examining rule, it says "the description of the noun" rather than just "description of the noun".


Top
 Profile Send private message  
Reply with quote  
 Post subject: Re: Articles of a value?
PostPosted: Sat Feb 25, 2012 12:40 pm 
Offline
User avatar

Joined: Thu Nov 04, 2010 6:30 am
Posts: 1102
Location: Gothenburg, Sweden
The issue would also affect the scene description text rule and possibly things said in other places than the Standard Rules. As far as I can tell the problem will occur whenever a rule tells the game to say "[the text]" or "[The text]". And presumably a corrsponding problem will occur for rules that tell the game to say "[a text]" or "[A text]".

I think I'd recommend this alternative fix:
Code:
To say a/an/the (T - text): say T.
To say A/An/The (T - text): say T.
To say a/an/the (T - indexed text): say T.
To say A/An/The (T - indexed text): say T.

_________________
Man ska inte tro allt man tänker.


Last edited by Felix Larsson on Sat Feb 25, 2012 3:07 pm, edited 1 time in total.

Top
 Profile Send private message  
Reply with quote  
 Post subject: Re: Articles of a value?
PostPosted: Sat Feb 25, 2012 1:05 pm 
Offline

Joined: Tue Mar 09, 2010 2:34 pm
Posts: 5311
Location: Burlington, VT
Felix, if I understand that aright, the idea is that the rules we've written for sayable values are already taking care of the articles, so we write rules for text and indexed text that ignore any articles that may be attached to them?


Top
 Profile Send private message  
Reply with quote  
 Post subject: Re: Articles of a value?
PostPosted: Sat Feb 25, 2012 1:56 pm 
Offline

Joined: Fri Feb 24, 2012 11:44 am
Posts: 14
OK, here's a new issue I'm having:
Code:
to say a (C - sayable value):
   if the C provides the property indefinite article and the indefinite article of C is not "":
      say "[indefinite article of C] [C]";
   otherwise:
      let first be character number 1 in "[C]" in lower case;
      if first is "a" or first is "e" or first is "i" or first is "o" or first is "u":
         say "an [C]";
      otherwise :
         say "a [C]".


Such that I could say:
Code:
Education is a kind of value. Education is High school, University, Academy, and Community College. Education has some text called indefinite article. The indefinite article of University is "a".

Tim is a person. Tim has an education called Education Level. The education level of Tim is University. The description of Tim is "He went to [a education level of item described]."

This works fine, until I do:
Code:
Hair color is a kind of value. Hair color is brown, black, auburn, ginger, red, blond, and chestnut.

Tim has a hair color. The hair color of Tim is auburn. The description of Tim is "He went to [a education level of item described]. [A hair color of item described] strand of hair falls in his eyes."

This fails with an error that "Hair color is not allowed to have an indefinite article", even though I'm trying to guard against using the indefinite article with the "provides property". This only happens with values, and would indicate that values are checked for properties at compile time while things check for properties at run time (if I try to use a property in string replacement that doesn't exist on a thing, it compiles and then fails at run time). So I wonder, is there a compile time way to check for property? I tried "to say a (C - sayable value which provides property indefinite article)", but that still fails with a compile time error where a C that shouldn't be going through this particular say apparently is going through this say.


Top
 Profile Send private message  
Reply with quote  
 Post subject: Re: Articles of a value?
PostPosted: Sat Feb 25, 2012 3:05 pm 
Offline
User avatar

Joined: Thu Nov 04, 2010 6:30 am
Posts: 1102
Location: Gothenburg, Sweden
matt w wrote:
Felix, if I understand that aright, the idea is that the rules we've written for sayable values are already taking care of the articles, so we write rules for text and indexed text that ignore any articles that may be attached to them?

Yes. The Standard Rules have a general phrase to say a sayable value, which I think, delegates that work to specific I6 routines for specific kinds of value, and then a special phrase to say objects with articles.
Standard Rules (A/sr5§2) wrote:
To say (value - sayable value of kind K): (- print ({-printing-routine:K}) {-pointer-to:value}; -).

What "To say the (T - text): say T" does is refer saying the text to the standard printing routine for text. And I guess that routine doesn't add any articles at all.

_________________
Man ska inte tro allt man tänker.


Top
 Profile Send private message  
Reply with quote  
 Post subject: Re: Articles of a value?
PostPosted: Mon Feb 27, 2012 1:32 pm 
Offline

Joined: Wed Oct 27, 2010 6:15 pm
Posts: 344
Code:
There is a room.

To say a (C - sayable value that provides the property indefinite article):
   if the indefinite article of C is not "":
      say "[indefinite article of C] [C]";
   otherwise:
      let first be character number 1 in "[C]" in lower case;
      if first is "a" or first is "e" or first is "i" or first is "o" or first is "u":
         say "an [C]";
      otherwise :
         say "a [C]".

Education is a kind of value. Education is High school, University, Academy, and Community College. Education has some text called indefinite article. The indefinite article of University is "a".

Tim is a person. Tim is here. Tim has an education called Education Level. The education level of Tim is University.

Hair color is a kind of value. Hair color is brown, black, auburn, ginger, red, blond, and chestnut.

Tim has a hair color. The hair color of Tim is auburn. The description of Tim is "He went to [a education level of item described]. [A hair color of item described] strand of hair falls in his eyes."

compiles cleanly for me. Does that match what you're trying?

(It compiles, but misbehaves. The bug looks similar to—but not the same as—825.)


Top
 Profile Send private message  
Reply with quote  
 Post subject: Re: Articles of a value?
PostPosted: Tue Feb 28, 2012 1:21 am 
Offline

Joined: Fri Feb 24, 2012 11:44 am
Posts: 14
I'm not sure why it didn't compile before since I don't have that particular attempt saved, but that code does compile. However, the function is never run, so it's hardly a surprise--the compile error I was seeing only occurred if a value without the property was passed into a function that might use that property. Since it never uses that particular function (it will use the default no-articles-for-values or the less specific override if it exists, even if the indefinite article is provided for the value), it never has the opportunity to fail the compile with the given error.
It's funny how it also breaks other functions beyond itself just by existing, though.


Top
 Profile Send private message  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 17 posts ]  Go to page Previous  1, 2

All times are UTC - 6 hours [ DST ]


Who is online

Users browsing this forum: Google [Bot] and 9 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