Does the player mean question

In my game I have two batteries and a battery compartment.

In the code I have:

Does the player mean taking battery compartment: it is very unlikely.

Shouldn’t this remove the compartment from disambiguation?

Possibly I have this wrong. I’m guessing the Does The Player Mean? code would select the battery if the choice was the compartment or one battery, but since there are two batteries and one thing with "battery’ in the name it lists all three? The compartment is part of a camera, so the player would never have the need to take the battery compartment. Is there a way to remove the compartment from consideration without renaming it?

I think you are correct: DTPM rules assign scores and pick something if it has the highest score, but if there is no unique highest score it asks the player to consider everything. Jon Ingold’s Disambiguation Control extension (which is updated for 6L02) should allow you to do this various ways; something like “should the game suggest the battery compartment when also considering a battery: never” should work. (If you’ve defined the batteries as part of a kind.) I haven’t looked up the syntax so it might be something different.