2 Data structures for saving variant expansions for ICU tokenizer.
4 from collections import namedtuple
6 _ICU_VARIANT_PORPERTY_FIELDS = ['lang']
9 class ICUVariantProperties(namedtuple('_ICUVariantProperties', _ICU_VARIANT_PORPERTY_FIELDS)):
10 """ Data container for saving properties that describe when a variant
13 Property instances are hashable.
16 def from_rules(cls, _):
17 """ Create a new property type from a generic dictionary.
19 The function only takes into account the properties that are
20 understood presently and ignores all others.
25 ICUVariant = namedtuple('ICUVariant', ['source', 'replacement', 'properties'])