Recently, while learning German I came across the articles
der, die and das.
which are used to indicate the gender of a noun.
So, categorizing the words into masculine, feminine and neutral does not seem to be straightforward.
What are the rules for categorization?