How do I split the starting traits by character gender in json?

I want to divide the starting traits by character gender so that when NPCs spawn, they are given traits based on their gender. I saw how to separate clothes by gender in the scripts, but it didn’t work out that way in “NPC_starting_traits” and features.