Java. Trie . Easy to read.
public class WordDictionary {\n        // Trie Node\n        class Node{ \n            // String word = ""; // will be set as  actual word when this node is "en
    public class WordDictionary {\n        // Trie Node\n        class Node{ \n            // String word = ""; // will be set as  actual word when this node is "end of the word". "" otherwise.\n            boolean isEnd = false;\n            Node[] subs = new Node[26]; // a-z\n        }\n        \n        private Node root = new Node(); //special value\n        \n        static int index(char c){\n            return c-'a';\n        }\n        \n        // Adds a word into the data structure.\n        public void addWord(String word) {\n            Node cur = root;\n            for(char c : word.toCharArray()){\n                if(cur.subs[index(c)] == null)\n                    cur.subs[index(c)] = new Node();\n                    \n                cur = cur.subs[index(c)]; // forward\n            }\n            \n            cur.isEnd = true;\n        }\n    \n        // Returns if the word is in the data structure. A word could\n        // contain the dot character '.' to represent any one letter.\n        public boolean search(String word) {\n            return search(root, word, 0);\n        }\n        \n        private boolean search (Node cur, String word, int idx){\n            if(cur == null) return false;\n            else if(idx == word.length()){\n                return cur.isEnd; // some words ended here.\n            }\n            \n            final char c = word.charAt(idx);\n            \n            if(c == '.'){\n                /*check existance*/\n                for(Node n : cur.subs)\n                    if(search (n, word, idx + 1))\n                        return true;\n                \n                return false;\n            }\n            else{\n                Node n = cur.subs[index(c)];\n                return search(n, word, idx +1);\n            }\n        }\n    \n    }
[]