In French, modifiers agree with the noun they are modifying not some other noun/pronoun in the sentence or understood to be the subject of the sentence.
Chapeau is masculine. Everything attached to it is masculine as well. All you need to know is the gender of chapeau. If it is important to clarify the gender of the subject, you have to reconstruct the sentence so that the gender of the subject is apparent.
I'm not sure what you mean by find the gender.
If you mean know the grammatical gender of a particular subject, whose gender you don't know, use the attached modifier. If you can't figure it out from the modifier then it is pretty tough. You just have to guess.
If you learn pomme = apple then you will always struggle with gender. If learn une pomme = an apple then gender issues will quickly disappear as a significant problem. If you learn all words with their attached article then the only issue is whether you properly learned the word in the first place.
If your question is about how to display the gender of the subject so that it is clear to listener/readers, then you have to reconstruct your sentence.
ok so usually-- and this rule applies to MOST of the time (not all) the ending of the word will tell you what the gender of the word is. i'll give you some examples. by the way, a good source to know more about this is " http://grammarist.com/french/french-noun-gender/ "
anyway, examples: masc. words usually don't end with e, but a lot do as well, so the endings would be more complicated, so you would have to memorize the endings.
MASC ENDINGS. (usually)
eau ien aire asme et isme in nt oir
FEM. ENDINGS (usually) ade aison ance ande ence ise son té tié ture ude
if you want an "always going to work" way to find the genders, though they may not always be present, you can search for "the" or "a".
un- masculine (a) une- feminine (a) le- masculine (the) la- feminine (the) l'- (not helpful as it goes before any word that starts with a vowel.) les- (also not helpful as it is the plural version of the and works with either masc. or fem. words)
Our subject at hand is the hat itself. We are putting it into possession, thus whatever the gender of that noun is, in this case, 'Le Chapeau' meaning 'The hat' the posssessive pronoun would need to be masculine based on the 'Le' given, of course, one would just need to that. Also, this is just my own idea, if you there's a better explanation I would love to know.
I believe it could be "Le chapeau de la sienne" ("The hat of hers.").
Other ways to say it: Son chapeau est à elle." ("The hat is hers."); "Son chapeau appartient à elle" ("The hat belongs to her") "Appartenir (à)=to belong (to).
You can also say "Le chapeau lui appartient," but then that needs context just like the original.
C'est le chapeau de Michelle. C'est son chapeau. ("It's his/her hat"; needs more context) C'est la sienne. (It's hers.) Le chapeau est à Michelle. (It's Michelles' hat) Ce chapeau appartient à Michelle. (This hat belongs to Michelle.)
I make a lot of mistakes because I just can't get over the anglo habit of attaching pronoun gender to the subject not the object.
Even though I know better I can still review an answer and not notice that the pronoun I typed reflects the gender of who owns not what is owned.
I definitely chose "sa", but only because I hadnt fully realized the rules of French. Duolingo doesn't teach you the rules of the language in the app, which, in my opinion, is a drawback. The only way to learn is by making mistakes and even then you're only given a short reason for why your answer is incorrect. If you're not versed in grammar and the grammatical rules of that language, it still won't make sense to you.
I understand why "sa" is incorrect now, and I can accept that objects are "genderized" in the French language. I know French and Spanish are like this. My next question is, Who decided that (inanimate) objects need a gender and why??? And I wonder if gender queer and gender neutral folks have any thoughts on this. To the Google!!
And all I want is for people to explain grammatical gender without all this bitterness, attitude, and sarcasm! I have come across several articles written by French speakers where the author is so busy trying to get back at all the people who have an issue with their gendered language that their words just drip with irritation and that's no good for people who are actually just trying to understand. I can barely get through these articles I'm reading because of the attitude of the French-speaking writers.
Attaching gender to nouns is a process that starts in the very beginning of the language. Since early cultures have a different relationship to the world around them than we do, there is no way to establish a logical reason for one choice of gender over another.
Also, communities might speak the same language approximately, however they were still separated from each other. Just moving around from town to town required a great expenditure of time, effort and expense.
As a result, one town would have one atypical language practice, another town would have a different one within the same language. Eventually, some centralizing authority would prescribe a common practice for a region. These prescriptions seldom had anything to do with linguistics and everything to do with power. Many times language practices were established by people who didn't speak the native language and didn't ever want to do so themselves but chose to set a standard for others. (peasants etc.)
From the point of view of learning a language, all languages are the way they are because that is the way they are. Speculating about the nature and origins of a language are very interesting pursuits. But they won't help you learn the language and will distract you from time spent practicing. But like I say, it is interesting.
You would have to change the French sentence structure so that it would back translate to English looking like...the hat of her. Naturally, when doing such a back translation of the French to English you would use the customary English structure and simply say or write ....her hat.
English her hat does not tell you if the hat belongs to Jane or Mary. Only context can tell you that. French son chapeau does not tell you if the hat belongs to Jane, Mary, Tom or Harry. Only context can tell you that. In both languages, if the listener needs more information than simple his/her/son/sa provides, then the sentence must be rearranged.
There are lots of other, more complex structures to show specific ownership in French just like there are in English.