1. A method for encoding a word or a plurality of words, comprising: parsing a sequential input string of symbols representing a word or a plurality of words into segments; constructing a graph having a plurality of spatial levels, each level including nodes; mapping the segments of the input string to the nodes according to the levels; and assigning attributes to the nodes according to the segments, wherein an entropy of the word or plurality of words is a constant times an entropy of the graph and of the nodal attributes.