nltk.FeatDict.__init__

FeatDict.__init__(features=None, **morefeatures)[source]

Create a new feature dictionary, with the specified features.

Parameters:
  • features – The initial value for this feature dictionary. If features is a FeatStruct, then its features are copied (shallow copy). If features is a dict, then a feature is created for each item, mapping its key to its value. If features is a string, then it is processed using FeatStructReader. If features is a list of tuples (name, val), then a feature is created for each tuple.
  • morefeatures – Additional features for the new feature dictionary. If a feature is listed under both features and morefeatures, then the value from morefeatures will be used.