This is similar to another question, but that one involves the nominative and accusative cases. There is also a question here which seems to be related but it's in German and I'm not sure that I understand it completely.
The example I came across is Ich kaufe meiner Freundin Schmuck, which was intended to mean "I'm buying my girlfriend jewelry." But when I ran it through Google translate it came back as "I buy my girlfriend's jewelry," which has a very different meaning. The problem seems to be that meiner Freundin can read as dative or genitive, there is nothing in the inflection of either word which distinguishes the cases. The word order doesn't really help either (as it might be in nom. vs. acc.) since both interpretations follow the normal order. Is there is a preferred interpretation for this kind of sentence? Is this situation unusual or do I have to keep checking every time I use a feminine noun in the dative that it can't be interpreted as genitive. (This example came up randomly; I only noticed the other possible meaning when I put it into Google translate.) Finally, what is the most natural way of resolving the ambiguity? I can see two options, first to rephrase using an article: Ich kaufe meiner Freundin ein Schmuckstück, and second to rephrase with a prepostion: Ich kaufe Schmuck für meine Freundin.