Is there a term for ascribing acts of the human mind to non-human objects, and when is it appropriate to do this?

Solution 1:

Anthropomorphism is not limited to physical appearance, and does not imply specifically a spiritual or soul element.

The attribution of human characteristics or behavior to a god, animal, or object

(Oxford Dictionaries)

So I believe it is the right term.

Solution 2:

An alternative to "anthropomorphism" is the word personification. It is almost identical in meaning to anthropomorphism, although perhaps a bit less technical.

According to Literary Devices, personification is:

Personification is a figure of speech in which a thing, an idea or an animal is given human attributes. The non-human objects are portrayed in such a way that we feel they have the ability to act like human beings. For example, when we say, “The sky weeps” we are giving the sky the ability to cry, which is a human quality. Thus, we can say that the sky has been personified in the given sentence.


On entirely another track, you might consider the word metonymy, where one word stands in for another related word, and is frequently used as a device for impersonalising a relationship or object. Thus, the "function" stands in for "the intent of the programmer", the "article" for the "written word and arguments of the author", and so on.

Per Your Dictionary:

Metonymies are frequently used in literature and in everyday speech. A metonymy is a word or phrase that is used to stand in for another word. Sometimes a metonymy is chosen because it is a well-known characteristic of the word.

One famous example of metonymy is the saying, "The pen is mightier than the sword," which originally came from Edward Bulwer Lytton's play Richelieu. This sentence has two examples of metonymy:

The "pen" stands in for "the written word." The "sword" stands in for "military aggression and force."