def create_string_table(workbook):
 strings = set()
 for sheet in workbook.worksheets:
  for cell in sheet.get_cell_collection():
   if ((cell.data_type == cell.TYPE_STRING) and (cell._value is not None)):
    strings.add(cell.value)
 return dict(((key, i) for (i, key) in enumerate(strings)))

def create_string_table ( workbook ) : strings = set ( ) for sheet in workbook . worksheets : for cell in sheet . get_cell_collection ( ) : if ( ( cell . data_type == cell . TYPE_STRING ) and ( cell . _value is not None ) ) : strings . add ( cell . value ) return dict ( ( ( key , i ) for ( i , key ) in enumerate ( strings ) ) )
compile the string table for a workbook .