# Path: nlglib/features/feature.py
# class FeatureGroup(object):
#     """Represents a group of features such as NUMBER or TENSE. """
# 
#     # TODO: consider using metaclasses and __slots__
# 
#     def __init__(self, name, *values, transform=None):
#         """Create a feature group with given values as Feature instances.
# 
#         The values are accessible as instance attributes. The values are
#         also stored in an instance variable (list) `values`.
# 
#         Note that the order of values matters! (intentionally)
# 
#         :param str name: the name of the group (eg NUMBER or TENSE)
#         :param str values: the individual feature values (eg first, second or present, past)
#         :param str transform: string transformation for given values ('lower', 'upper' or None)
# 
#         >>> NUMBER = FeatureGroup('NUMBER', 'singular', 'plural')
#         >>> NUMBER.singular
#         <Feature NUMBER: singular>
# 
#         """
# 
#         def ident(x):
#             return x
# 
#         fn = ident
#         if transform:
#             fn = getattr(str, transform)
#         self.transform = fn
#         self.name = name
#         self.values = list(values)
#         for v in values:
#             setattr(self, fn(v), Feature(name, fn(v)))
# 
#     def __str__(self):
#         return self.name
# 
#     def __repr__(self):
#         return '<FeatureGroup {0}: {1}>'.format(self.name, ', '.join(self.values))
# 
#     def __len__(self):
#         return len(self.values)
# 
#     def __getitem__(self, item):
#         return self.values[item]
# 
#     def __contains__(self, item):
#         if isinstance(item, str):
#             return item in self.values
#         elif isinstance(item, Feature):
#             return item.name == self.name and item.value in self.values
#         else:
#             return False
# 
#     def __eq__(self, other):
#         """Return True if `other` is the same FeatureGroup
#         or if it is a `Feature` with the same name
# 
#         """
#         if isinstance(other, FeatureGroup):
#             return self.name == other.name and self.values == other.values
#         elif isinstance(other, Feature):
#             return self.name == other.name
#         else:
#             return False
# 
#     def __hash__(self):
#         # hash uses only the name so that we can compare with Feature
#         return hash(self.name)
# 
#     def __getattr__(self, item):
#         item = self.transform(item)
#         return super(FeatureGroup, self).__getattribute__(item)


from nlglib.features.feature import FeatureGroup
DOCUMENT = "DOCUMENT"
# List of sentences
PARAGRAPH = "PARAGRAPH"
# RST relation
RST = "RST_RELATION"
# Message Specification
MSG = 'MESSAGE_SPECIFICATION'

# Part of speech tags
pos_category = FeatureGroup(
    'POS',
    ANY,
    ADJECTIVE,
    ADVERB,
    AUXILIARY,
    COMPLEMENTISER,
    CONJUNCTION,
    DETERMINER,
    INTERJECTION,
    MODAL,
    NOUN,
    NUMERAL,
    PARTICLE,
    PREPOSITION,
    PRONOUN,
    SYMBOL,
    VERB,
    transform='lower'
)


# Path: nlglib/features/feature.py
# class FeatureGroup(object):
#     """Represents a group of features such as NUMBER or TENSE. """
# 
#     # TODO: consider using metaclasses and __slots__
# 
#     def __init__(self, name, *values, transform=None):
#         """Create a feature group with given values as Feature instances.
# 
#         The values are accessible as instance attributes. The values are
#         also stored in an instance variable (list) `values`.
# 
#         Note that the order of values matters! (intentionally)
# 
#         :param str name: the name of the group (eg NUMBER or TENSE)
#         :param str values: the individual feature values (eg first, second or present, past)
#         :param str transform: string transformation for given values ('lower', 'upper' or None)
# 
#         >>> NUMBER = FeatureGroup('NUMBER', 'singular', 'plural')
#         >>> NUMBER.singular
#         <Feature NUMBER: singular>
# 
#         """
# 
#         def ident(x):
#             return x
# 
#         fn = ident
#         if transform:
#             fn = getattr(str, transform)
#         self.transform = fn
#         self.name = name
#         self.values = list(values)
#         for v in values:
#             setattr(self, fn(v), Feature(name, fn(v)))
# 
#     def __str__(self):
#         return self.name
# 
#     def __repr__(self):
#         return '<FeatureGroup {0}: {1}>'.format(self.name, ', '.join(self.values))
# 
#     def __len__(self):
#         return len(self.values)
# 
#     def __getitem__(self, item):
#         return self.values[item]
# 
#     def __contains__(self, item):
#         if isinstance(item, str):
#             return item in self.values
#         elif isinstance(item, Feature):
#             return item.name == self.name and item.value in self.values
#         else:
#             return False
# 
#     def __eq__(self, other):
#         """Return True if `other` is the same FeatureGroup
#         or if it is a `Feature` with the same name
# 
#         """
#         if isinstance(other, FeatureGroup):
#             return self.name == other.name and self.values == other.values
#         elif isinstance(other, Feature):
#             return self.name == other.name
#         else:
#             return False
# 
#     def __hash__(self):
#         # hash uses only the name so that we can compare with Feature
#         return hash(self.name)
# 
#     def __getattr__(self, item):
#         item = self.transform(item)
#         return super(FeatureGroup, self).__getattribute__(item)


# Path: nlglib/features/category.py
from nlglib.features.feature import FeatureGroup

DOCUMENT = "DOCUMENT"
# List of sentences
PARAGRAPH = "PARAGRAPH"
# RST relation
RST = "RST_RELATION"
# Message Specification
MSG = 'MESSAGE_SPECIFICATION'

# Part of speech tags
pos_category = FeatureGroup(
    'POS',
    ANY,
    ADJECTIVE,
    ADVERB,
    AUXILIARY,
    COMPLEMENTISER,
    CONJUNCTION,
    DETERMINER,
    INTERJECTION,
    MODAL,
    NOUN,
    NUMERAL,
    PARTICLE,
    PREPOSITION,
    PRONOUN,
    SYMBOL,
    VERB,
    transform='lower'
)


element_category = FeatureGroup(