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):
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
- The script first searches a world list.
- If the script cannot find the word in the list it will use grammar rules to find its gender.
- 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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for german-gender-finder-1.0.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | f2b407499dc254268b04ed11150c575165824061c06aeceb4a8731baa5bd591b |
|
MD5 | 8d5c072ac8878ae6da1539d8b45853fa |
|
BLAKE2b-256 | 8bb55bbc4a05061761e2d3480629ff2d6bbb1667c175eea3682c4b4ce993f27a |
Close
Hashes for german_gender_finder-1.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 095389c11dc019a8a0d220524f511de9816ddd96a7660e2c5aff26421bb4230a |
|
MD5 | 226d5d041f425694db5691ba5d0e0642 |
|
BLAKE2b-256 | a8695962ca3af823bf4c9c9324a3aec7ea41500c4ecf1ed3bb5576933cda357f |