Jump to content

Wikifunctions:Type proposals/Grammatical gender (m/f/n)

From Wikifunctions

Summary

This enumeration represents the masculine, feminine, and neuter grammatical gender for languages that have exactly these three genders.

Done: Z25501

Uses

  • Why should this exist?

To work with languages that have three grammatical genders, such as German or Croatian.

  • What kinds of functions would be created using this?

Mappings to Wikidata items, selecting the right adjective form, getting the grammatical gender of a noun, etc.

  • What standard concepts, if any, does this align with?

Grammars of the respective languages.

See List on Wikipedia.

Structure

This type is represented as an enumeration with three values. Like all enumeration types, it consists of a single key. The key is an identity key.

Values

There are three values.

  1. Feminine
  2. Masculine
  3. Neuter

Example values

Value

{
  "type": "Grammatical gender (m/f/n)",
  "value": "Masculine"
}
{
  "Z1K1": "Znnnnn",
  "ZnnnnnK1": "Zmmmmm"
}

Validator

The validator ensures that:

  • the identity key points directly to a value of this enumeration

Identity

Two values are the same if their identity is the same ZID.

Converting to code

Python

We represent them as a String with their ZID.

JavaScript

We represent them as a String with their ZID.

Renderer

As for all enumerations, the renderer displays the label of the value object.

Parsers

As with all enumerations, there is no parser, but a selector based on pre-defined values.

Alternatives

  • Instead of an enumeration, this could be a type with a single key that has a Wikidata item reference pointing to the respective item
  • In the code conversion, we could represent them as a Number. Both requires an arbitrary mapping that may be regarded as problematic.
  • In the code conversion, we could use a simple string "m", "f" or "n".
  • We could skip this type and just have a single type collecting all grammatical genders.
  • We could skip this type and just use Wikidata items directly instead.

Comments

Discussion

Some of the discussion for this type and the related types (m/f, c/n and a/i) should probably be had in a single centralized place. I suggest Wikifunctions:Project chat#Natural language functions.