I know it isnt the same but from doing Italian, to distinguish between masculine and feminine, Im pretty sure its to do with the letters that words in. Like if you have a word ending in 'o' or 'e', that might symbolise a masculine word. Or an 'a' may be a feminine word. Those are just examples so dont take my word for it.