Example #1
0
 private void insertHyphPattern(char[] chars, int[] pattern) {
   // find target node, building as we go
   Node cur = head;
   for (int c = 0; c < chars.length; ++c) {
     Character curchar = new Character(chars[c]);
     Node next = (Node) cur.children.get(curchar);
     if (next == null) {
       next = new Node();
       cur.children.put(curchar, next);
     }
     cur = next;
   }
   assert (cur.pattern == null);
   cur.pattern = pattern;
 }