def add pattern
			node = @root

			# If this is a string process each character
			if String(pattern) == pattern
				pattern.each_char do |char|
					if node.goto(char) == nil
						node = node.add(char)
					else
						node = node.goto(char)
					end
				end
			else # Otherwise, pattern should support "each" method.
				for item in pattern
					if node.goto(item) == nil
						node = node.add(item)
					else
						node = node.goto(item)
					end
				end
			end

			if block_given?
				node.output = yield pattern
			else
				node.output = [pattern]
			end
		end
def add pattern
			node = @root

			# If this is a string process each character
			if String(pattern) == pattern
				pattern.each_char do |char|
					if node.goto(char) == nil
						node = node.add(char)
					else
						node = node.goto(char)
					end
				end
			else # Otherwise, pattern should support "each" method.
				for item in pattern
					if node.goto(item) == nil
						node = node.add(item)
					else
						node = node.goto(item)
					end
				end
			end

			if block_given?
				node.output = yield pattern
			else
				node.output = [pattern]
			end
		end
Creates an empty AhoC Trie with only a root node

 Accepts an optional argument (either :DFA or :NFA)
 indicating the type of automaton to build. If no
 argument is passed an NFA will be built.
 Add a pattern to the Trie.

 Accepts an optional block that can be used
 to modify the node output.