Giter VIP home page Giter VIP logo

german-gender-finder's Introduction

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. the list has around 30.000 words. All commonly used words are there.
  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, This will be the response in allmost all cases, due to the size of the wordlist
{
  '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.

german-gender-finder's People

Contributors

lsmith77 avatar p3ngy avatar pimverleg avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

german-gender-finder's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.