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

Function indefinite_article

pattern/text/en/inflect.py:72–79  ·  view source on GitHub ↗

Returns the indefinite article for a given word. For example: indefinite_article("university") => "a" university.

(word)

Source from the content-addressed store, hash-verified

70 return "the"
71
72def indefinite_article(word):
73 """ Returns the indefinite article for a given word.
74 For example: indefinite_article("university") => "a" university.
75 """
76 word = word.split(" ")[0]
77 for rule, article in RE_ARTICLE:
78 if rule.search(word) is not None:
79 return article
80
81DEFINITE, INDEFINITE = \
82 "definite", "indefinite"

Callers 1

articleFunction · 0.70

Calls 2

splitMethod · 0.45
searchMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…