forked from udapi/udapi-python
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfeats.py
More file actions
18 lines (13 loc) · 655 Bytes
/
feats.py
File metadata and controls
18 lines (13 loc) · 655 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
"""Feats class for storing morphological features of nodes in UD trees."""
import udapi.core.dualdict
class Feats(udapi.core.dualdict.DualDict):
"""Feats class for storing morphological features of nodes in UD trees.
See http://universaldependencies.org/u/feat/index.html for the specification of possible
feature names and values.
"""
def is_singular(self):
"""Is the grammatical number singular (feats['Number'] contains 'Sing')?"""
return 'Sing' in self['Number']
def is_plural(self):
"""Is the grammatical number plural (feats['Number'] contains 'Plur')?"""
return 'Plur' in self['Number']