A method and improved data structure for attaching information to words in
a trie of nodes. Each node of a trie includes a single tag bit which is
interpreted according to information specified in a header of the trie.
The information may specify that a node may be tagged with multiple tags,
whereby if the tag bit is set in a given node, the node further includes
a bitmask indicating which one or ones of the tags apply to that node. A
value mask may be provided in the header indicating which of the tags (if
any) have values associated therewith, whereby information representative
of the value such as the value itself or a pointer thereto is stored in
each node tagged with at least one tag having an associated value.
Partial enumeration of tagged nodes may be provided by storing a count of
the number of tagged words under a node, wherein if a trie has multiple
tags, each tag may be selectively and separately enumerated as specified
in header information. Partial enumeration may be combined with global
enumeration of each word, with multiple tags, and/or with tags that have
associated values.