def wordlist_to_graph_file(wordlist, dbfile, strip=True):
 from whoosh.filedb.structfile import StructFile
 g = GraphCorrector.from_word_list(wordlist, strip=strip)
 if isinstance(dbfile, string_type):
  dbfile = open(dbfile, 'wb')
 if (not isinstance(dbfile, StructFile)):
  dbfile = StructFile(dbfile)
 g.to_file(dbfile)

def wordlist_to_graph_file ( wordlist , dbfile , strip = True ) : from whoosh . filedb . structfile import StructFile g = GraphCorrector . from_word_list ( wordlist , strip = strip ) if isinstance ( dbfile , string_type ) : dbfile = open ( dbfile , 'wb' ) if ( not isinstance ( dbfile , StructFile ) ) : dbfile = StructFile ( dbfile ) g . to_file ( dbfile )
writes a word graph file from a list of words .