'Creates structure for given ruleset in the trie.
@param ruleset: rules.Ruleset instance'

def addRuleset(self, ruleset):

    for target in ruleset.targets:
        node = self.root
        parts = list(enumerate(target.split('.')))
        depth = 0
        for (idx, part) in reversed(parts):
            depth += 1
            partNode = node.children.get(part)
            if (not partNode):
                partNode = DomainNode(part, [], depth)
                node.addChild(partNode)
            if (idx == 0):
                partNode.rulesets.append(ruleset)
            node = partNode
