Skip to main content

Find the gender of a german word

Project description

German-gender-finder

Find the gender of the German word.

You can use this script to find out what article your german word needs. Der, Die or Das

Usage

Finding the gender of the word "Besuch" directly from the command line (cmd):

image

Or from within a script

import find_gender
print(find_gender.get_gender_of_word('mutter'))
#{'word': 'mutter', 'definite_article': 'die', 'indefinite_article': 'eine', 'warning': 'Sure: Found in word list, highly reliable'}

Notes

  1. The script first searches a world list.
  2. If the script cannot find the word in the list it will use grammar rules to find its gender.
  3. All words that are exceptions to rules should be in the list.

return values

The script always returns a dictionary with a warning message detailing the reliability:

# very reliable
{
  'word': 'somewordyouchose', 
  'definite_article': 'die',
  'indefinite_article': 'eine',
  'warning': 'Sure: Found in word list, highly reliable'
}


# very reliable
{
    'word': 'somewordyouchose',
    'definite_article': 'der',
    'indefinite_article': 'ein',
    'warning': 'Sure: male due to masculine ending'
}

# not sure, see warning message!
{
     'word': 'somewordyouchose',
     'definite_article': 'der',
     'indefinite_article': 'ein',
     'warning': 'Unsure: However 80% of words ending in "en" are masculine'
}

# all messages you could get:

'warning': 'Sure: Found in word list',
'warning': 'Sure: male due to masculine ending',
'warning': 'Sure: female due to feminine ending',
'warning': 'Sure: neuter due to neuter ending',
'warning': 'Unsure: However 80% of words ending in "en" are masculine',
'warning': 'Unsure: However 60% of nouns ending in "el" are masculine',
'warning': 'Unsure: However 60% of nouns ending in "er" are masculine',
'warning': 'Unsure: However 90% of nouns ending in "e" are masculine',
'warning': 'Unsure: However 90% of nouns starting with "ge" are feminine',
'warning': 'Unsure: Most nouns ending in -t originating from verbs are feminine.',
'warning': 'Not_found: word not found',
 

The words in the word list are taken from:

https://github.com/mejutoco/german-grammar-statistics

I removed all words without a gender assigned.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

german-gender-finder-1.0.0.tar.gz (4.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

german_gender_finder-1.0.0-py3-none-any.whl (4.6 kB view details)

Uploaded Python 3

File details

Details for the file german-gender-finder-1.0.0.tar.gz.

File metadata

  • Download URL: german-gender-finder-1.0.0.tar.gz
  • Upload date:
  • Size: 4.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.6

File hashes

Hashes for german-gender-finder-1.0.0.tar.gz
Algorithm Hash digest
SHA256 f2b407499dc254268b04ed11150c575165824061c06aeceb4a8731baa5bd591b
MD5 8d5c072ac8878ae6da1539d8b45853fa
BLAKE2b-256 8bb55bbc4a05061761e2d3480629ff2d6bbb1667c175eea3682c4b4ce993f27a

See more details on using hashes here.

File details

Details for the file german_gender_finder-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for german_gender_finder-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 095389c11dc019a8a0d220524f511de9816ddd96a7660e2c5aff26421bb4230a
MD5 226d5d041f425694db5691ba5d0e0642
BLAKE2b-256 a8695962ca3af823bf4c9c9324a3aec7ea41500c4ecf1ed3bb5576933cda357f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page