#NEWLINE# def LoadCoTermStats( self , table_name , var_name ) : #NEWLINE# #INDENT# ( termOffset , termLimit ) = self . GetTermLimits ( ) #NEWLINE# query = 'SELECT stats.value AS value, ref1.term_text AS first_term, ref2.term_text as second_term \n\t\tFROM {TABLE} AS stats \n\t\tINNER JOIN term_texts as ref1 ON stats.first_term_index = ref1.term_index \n\t\tINNER JOIN term_texts as ref2 ON stats.second_term_index = ref2.term_index \n\t\tORDER BY stats.rank LIMIT {LIMIT} OFFSET {OFFSET}' . format ( TABLE = table_name , LIMIT = termLimit , OFFSET = termOffset ) #NEWLINE# rows = self . db . executesql ( query , as_dict = True ) #NEWLINE# header = [ { #NEWLINE# #INDENT# 'name' : 'first_term' , #NEWLINE# 'type' : self . db . term_texts . term_text . type , #NEWLINE# #UNINDENT# } , { #NEWLINE# #INDENT# 'name' : 'second_term' , #NEWLINE# 'type' : table_name . db . term_texts . term_text . type , #NEWLINE# #UNINDENT# } , { #NEWLINE# #INDENT# 'name' : 'value' , #NEWLINE# 'type' : self . db [ table_name ] . value . type , #NEWLINE# #UNINDENT# } ] #NEWLINE# self . content . update ( { #NEWLINE# #INDENT# var_name : rows , #NEWLINE# 'TermLimit' : termLimit , #NEWLINE# 'TermOffset' : termOffset , #NEWLINE# 'CellCount' : self . db ( self . db [ table_name ] ) . count ( ) , #NEWLINE# 'TermCount' : self . db ( self . db . term_texts ) . count ( ) , #NEWLINE# #UNINDENT# } ) #NEWLINE# self . table = rows #NEWLINE# self . header = header