public void Append(HyphenatorPattern pattern)
 {
     if (pattern == null) throw new ArgumentNullException("pattern");
     if (string.IsNullOrEmpty(pattern.Text)) return;
     var node = this;
     foreach(var character in pattern.Text)
     {
         HyphenationTreeNode next;
         if(!node.Children.TryGetValue(character, out next))
         {
             next = new HyphenationTreeNode();
             node.Children.Add(character, next);
         }
         node = next;
     }
     node.Points = pattern.Points;
 }
 public void Can_replace_hexadecimal_characters()
 {
     var result = new HyphenatorPattern("t2^^f63st");
     Assert.That(result.Text, Is.EqualTo("töst"));
     Assert.That(result.Points, Is.EqualTo(new[] { 0, 2, 3, 0, 0 }));
 }
 public void Can_read_raw_string()
 {
     var result = new HyphenatorPattern("test");
     Assert.That(result.Text, Is.EqualTo("test"));
     Assert.That(result.Points, Is.EqualTo(new[] { 0, 0, 0, 0, 0 }));
 }
 public void Can_read_vote_strings()
 {
     var result = new HyphenatorPattern("te1st2");
     Assert.That(result.Text, Is.EqualTo("test"));
     Assert.That(result.Points, Is.EqualTo(new[] { 0, 0, 1, 0, 2 }));
 }