@classmethod<EOL><INDENT>def init_word_db(cls, name, text):<DEDENT>
<EOL>text = text.replace('<STR_LIT:\n>', '<STR_LIT:U+0020>').replace('<STR_LIT:\r>', '<STR_LIT:U+0020>')<EOL>words = [w.strip() for w in text.split('<STR_LIT:U+0020>') if w.strip()]<EOL>assert len(words) > <NUM_LIT:2>,'<STR_LIT>'<EOL>freqs = {}<EOL>for i in range(len(words) - <NUM_LIT:2>):<EOL><INDENT>w1 = words[i]<EOL>w2 = words[i + <NUM_LIT:1>]<EOL>w3 = words[i + <NUM_LIT:2>]<EOL>key = (w1, w2)<EOL>if key in freqs:<EOL><INDENT>freqs[key].append(w3)<EOL><DEDENT>else:<EOL><INDENT>freqs[key] = [w3]<EOL><DEDENT><DEDENT>cls._dbs[name] = {<EOL>'<STR_LIT>': freqs,<EOL>'<STR_LIT>': words,<EOL>'<STR_LIT>': len(words) - <NUM_LIT:2><EOL>}<EOL>
Initialize a database of words for the maker with the given name