Variations of a single piece of content can be stored within a Trie data
structure to enable finding applicable versions of the content. The
Trie maps the components of the language tag in a path. Like a
bitmapped Trie or a string Trie each branch of the tree can also
contain an element.
The find operation allows the most specific version of a given piece
of content to be found within the Trie.
An exact match
let trie = fromList [(enGBTJP, "foo"), (enGB, "colour")]
find enGBTJP trie `shouldBe` Just "foo"
Or just a relevant match
let trie = fromList [(en, "color"), (enGB, "colour")]
find enTJP trie `shouldBe` Just "color"
Variations of a single piece of content can be stored within a
Trie
data structure to enable finding applicable versions of the content. TheTrie
maps the components of the language tag in a path. Like a bitmappedTrie
or a stringTrie
each branch of the tree can also contain an element.The
find
operation allows the most specific version of a given piece of content to be found within theTrie
.An exact match
Or just a relevant match