Returns the definite article for a given word.
(word, gender=MALE)
| 61 | zs = lambda w: w and (w[:1] == "z" or (w[:1] == "s" and not is_vowel(w[1:2]))) |
| 62 | |
| 63 | def definite_article(word, gender=MALE): |
| 64 | """ Returns the definite article for a given word. |
| 65 | """ |
| 66 | if PLURAL in gender and MALE in gender and (is_vowel(word[:1]) or zs(word)): |
| 67 | return "gli" |
| 68 | if PLURAL not in gender and word and is_vowel(word[:1]): |
| 69 | return "l'" |
| 70 | if PLURAL not in gender and MALE in gender and zs(word): |
| 71 | return "lo" |
| 72 | if MALE in gender: |
| 73 | return PLURAL in gender and "i" or "il" |
| 74 | if FEMALE in gender: |
| 75 | return PLURAL in gender and "le" or "la" |
| 76 | return "il" |
| 77 | |
| 78 | def indefinite_article(word, gender=MALE): |
| 79 | """ Returns the indefinite article for a given word. |