MCPcopy Index your code
hub / github.com/clips/pattern / indefinite_article

Function indefinite_article

pattern/text/it/inflect.py:78–89  ·  view source on GitHub ↗

Returns the indefinite article for a given word.

(word, gender=MALE)

Source from the content-addressed store, hash-verified

76 return "il"
77
78def indefinite_article(word, gender=MALE):
79 """ Returns the indefinite article for a given word.
80 """
81 if MALE in gender and zs(word):
82 return PLURAL in gender and "degli" or "uno"
83 if MALE in gender:
84 return PLURAL in gender and "dei" or "un"
85 if FEMALE in gender and is_vowel(word[:1]):
86 return PLURAL in gender and "delle" or "un'"
87 if FEMALE in gender:
88 return PLURAL in gender and "delle" or "una"
89 return "un"
90
91DEFINITE, INDEFINITE = \
92 "definite", "indefinite"

Callers 1

articleFunction · 0.70

Calls 1

is_vowelFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…