Menu

#6 Add missing pronouns and capitalization

1.0
open
nobody
None
2020-07-15
2020-07-15
Lee Harr
No

Originally reported on Google Code with ID 14 ```

Some pronouns have been fixed for the person issuing the command but for a second person most actions are reported with pronouns missing.

rose appears (Expected: A rose appears)

Jay drops ring (Expected: Jay drops the ring)

I also get:

remove ring

You remove ring

I expect the same problem to exists other commands, as I have only tried very few of them.

This issue a very good example of why hardcoding string concatenation in so many methods can quickly become a maintainance hell.

Having a specialized method for that not only prevents these bugs but also makes it easier to add support for capitalization.

Here's a very simplistic example of what I mean:

def reportEvent(subj, action, obj=None):

str1 = subj.name str2 = ' ' + action str3 = '' if type(subj) == Item: str1 = 'The ' + str1

if obj:

str3 = obj.name if type(obj) == Item: str3 = ' the ' + obj.name

print str1 + str2 + str3 + '.'

subj = Actor('Lee') item1 = Item("rose") item2 = Item("floor")

reportEvent( subj, "disappears") reportEvent( subj, "gets", item1 ) reportEvent( item, "hits", item2 )

Lee disappears. Lee gets the rose. The rose hits the floor.

```

Reported by hello.jay.araujo on 2009-01-11 20:28:21
Comments (3)

Former user Account Deleted

``` Sorry, I should have separated my personal comments from the bug report itself.

Next time I will make sure I do that. ```

Reported by `hello.jay.araujo` on 2009-01-11 20:46:12
    2009-01-11
Former user Account Deleted

``` The "the"s are fixed for the player in wear and remove (r343), but that's the easy part.

A and An will be much more difficult.

A while back, I actually almost started removing all of the messages from the command code, and putting it in to the room actions, but I was not sure it would be

worth the trouble.

I also see what you are saying about the room messages being all without "the".

It seems to be even more complicated though:

look

You look at room.

You see some items here: rose rose get rose You get the rose.

Shouldn't that be "you get _a_ rose" ?

This could get messy....

```

Reported by `missive@hotmail.com` on 2009-01-18 21:59:59 - Status changed: `Accepted`
    2009-01-18
Former user Account Deleted

```

Yeah maybe, or even "You get one of the roses." if you want to be fancy.

However, the fix is to have an article. If it's the most appropriate or not that would be an enhancement and could be target after the release milestone, imo.

```

Reported by `hello.jay.araujo` on 2009-01-18 22:12:46
    2009-01-18

Discussion


Log in to post a comment.