((lp0
V#!/usr/bin/env python
p1
aVstrings=['hey','guys','i','am','a','string']
p2
aVparameter_list=[[strings]]
p3
aVdef features_string_char_modular (strings):
p4
aV	from modshogun import StringCharFeatures, RAWBYTE
p5
aV	from numpy import array
p6
aV	#create string features
p7
aV	f=StringCharFeatures(strings, RAWBYTE)
p8
aV	#and output several stats
p9
aV	#print("max string length", f.get_max_vector_length())
p10
aV	#print("number of strings", f.get_num_vectors())
p11
aV	#print("length of first string", f.get_vector_length(0))
p12
aV	#print("string[5]", ''.join(f.get_feature_vector(5)))
p13
aV	#print("strings", f.get_features())
p14
aV	#replace string 0
p15
aV	f.set_feature_vector(array(['t','e','s','t']), 0)
p16
aV	#print("strings", f.get_features())
p17
aV	return f.get_features(), f
p18
aVif __name__=='__main__':
p19
aV	print('StringCharFeatures')
p20
aV	features_string_char_modular(*parameter_list[0])
p21
acmodshogun
_sg_reconstructor
p22
(cmodshogun
StringCharFeatures
p23
c__builtin__
object
p24
Ntp25
Rp26
(I01
c_codecs
encode
p27
(V<<_SHOGUN_SERIALIZABLE_ASCII_FILE_V_00_>>\u000aversion_parameter int32 1\u000aproperties uint64 0\u000acache_size int32 0\u000apreproc SGSerializable* DynamicObjectArray [\u000aversion_parameter int32 1\u000aarray Vector<SGSerializable*> 0 ()\u000anum_elements int32 0\u000aresize_granularity int32 128\u000ause_sg_malloc bool t\u000afree_array bool t\u000a]\u000apreprocessed SGSerializable* DynamicArray bool [\u000aversion_parameter int32 1\u000aarray Vector<bool> 0 ()\u000anum_elements int32 0\u000aresize_granularity int32 128\u000ause_sg_malloc bool t\u000afree_array bool t\u000a]\u000asubset_stack SGSerializable* SubsetStack [\u000aversion_parameter int32 1\u000aactive_subset SGSerializable* null []\u000aactive_subsets_stack SGSerializable* DynamicObjectArray [\u000aversion_parameter int32 1\u000aarray Vector<SGSerializable*> 0 ()\u000anum_elements int32 0\u000aresize_granularity int32 128\u000ause_sg_malloc bool t\u000afree_array bool t\u000a]\u000a]\u000aalphabet SGSerializable* Alphabet [\u000aversion_parameter int32 1\u000aalphabet int32 7\u000anum_symbols int32 256\u000anum_bits int32 8\u000a]\u000afeatures Vector<String<char>> 21 ({21 [{35}{33}{47}{117}{115}{114}{47}{98}{105}{110}{47}{101}{110}{118}{32}{112}{121}{116}{104}{111}{110}]}{44 [{115}{116}{114}{105}{110}{103}{115}{61}{91}{39}{104}{101}{121}{39}{44}{39}{103}{117}{121}{115}{39}{44}{39}{105}{39}{44}{39}{97}{109}{39}{44}{39}{97}{39}{44}{39}{115}{116}{114}{105}{110}{103}{39}{93}]}{26 [{112}{97}{114}{97}{109}{101}{116}{101}{114}{95}{108}{105}{115}{116}{61}{91}{91}{115}{116}{114}{105}{110}{103}{115}{93}{93}]}{43 [{100}{101}{102}{32}{102}{101}{97}{116}{117}{114}{101}{115}{95}{115}{116}{114}{105}{110}{103}{95}{99}{104}{97}{114}{95}{109}{111}{100}{117}{108}{97}{114}{32}{40}{115}{116}{114}{105}{110}{103}{115}{41}{58}]}{50 [{9}{102}{114}{111}{109}{32}{109}{111}{100}{115}{104}{111}{103}{117}{110}{32}{105}{109}{112}{111}{114}{116}{32}{83}{116}{114}{105}{110}{103}{67}{104}{97}{114}{70}{101}{97}{116}{117}{114}{101}{115}{44}{32}{82}{65}{87}{66}{89}{84}{69}]}{24 [{9}{102}{114}{111}{109}{32}{110}{117}{109}{112}{121}{32}{105}{109}{112}{111}{114}{116}{32}{97}{114}{114}{97}{121}]}{24 [{9}{35}{99}{114}{101}{97}{116}{101}{32}{115}{116}{114}{105}{110}{103}{32}{102}{101}{97}{116}{117}{114}{101}{115}]}{39 [{9}{102}{61}{83}{116}{114}{105}{110}{103}{67}{104}{97}{114}{70}{101}{97}{116}{117}{114}{101}{115}{40}{115}{116}{114}{105}{110}{103}{115}{44}{32}{82}{65}{87}{66}{89}{84}{69}{41}]}{26 [{9}{35}{97}{110}{100}{32}{111}{117}{116}{112}{117}{116}{32}{115}{101}{118}{101}{114}{97}{108}{32}{115}{116}{97}{116}{115}]}{55 [{9}{35}{112}{114}{105}{110}{116}{40}{34}{109}{97}{120}{32}{115}{116}{114}{105}{110}{103}{32}{108}{101}{110}{103}{116}{104}{34}{44}{32}{102}{46}{103}{101}{116}{95}{109}{97}{120}{95}{118}{101}{99}{116}{111}{114}{95}{108}{101}{110}{103}{116}{104}{40}{41}{41}]}{49 [{9}{35}{112}{114}{105}{110}{116}{40}{34}{110}{117}{109}{98}{101}{114}{32}{111}{102}{32}{115}{116}{114}{105}{110}{103}{115}{34}{44}{32}{102}{46}{103}{101}{116}{95}{110}{117}{109}{95}{118}{101}{99}{116}{111}{114}{115}{40}{41}{41}]}{57 [{9}{35}{112}{114}{105}{110}{116}{40}{34}{108}{101}{110}{103}{116}{104}{32}{111}{102}{32}{102}{105}{114}{115}{116}{32}{115}{116}{114}{105}{110}{103}{34}{44}{32}{102}{46}{103}{101}{116}{95}{118}{101}{99}{116}{111}{114}{95}{108}{101}{110}{103}{116}{104}{40}{48}{41}{41}]}{54 [{9}{35}{112}{114}{105}{110}{116}{40}{34}{115}{116}{114}{105}{110}{103}{91}{53}{93}{34}{44}{32}{39}{39}{46}{106}{111}{105}{110}{40}{102}{46}{103}{101}{116}{95}{102}{101}{97}{116}{117}{114}{101}{95}{118}{101}{99}{116}{111}{114}{40}{53}{41}{41}{41}]}{36 [{9}{35}{112}{114}{105}{110}{116}{40}{34}{115}{116}{114}{105}{110}{103}{115}{34}{44}{32}{102}{46}{103}{101}{116}{95}{102}{101}{97}{116}{117}{114}{101}{115}{40}{41}{41}]}{18 [{9}{35}{114}{101}{112}{108}{97}{99}{101}{32}{115}{116}{114}{105}{110}{103}{32}{48}]}{50 [{9}{102}{46}{115}{101}{116}{95}{102}{101}{97}{116}{117}{114}{101}{95}{118}{101}{99}{116}{111}{114}{40}{97}{114}{114}{97}{121}{40}{91}{39}{116}{39}{44}{39}{101}{39}{44}{39}{115}{39}{44}{39}{116}{39}{93}{41}{44}{32}{48}{41}]}{36 [{9}{35}{112}{114}{105}{110}{116}{40}{34}{115}{116}{114}{105}{110}{103}{115}{34}{44}{32}{102}{46}{103}{101}{116}{95}{102}{101}{97}{116}{117}{114}{101}{115}{40}{41}{41}]}{27 [{9}{114}{101}{116}{117}{114}{110}{32}{102}{46}{103}{101}{116}{95}{102}{101}{97}{116}{117}{114}{101}{115}{40}{41}{44}{32}{102}]}{24 [{105}{102}{32}{95}{95}{110}{97}{109}{101}{95}{95}{61}{61}{39}{95}{95}{109}{97}{105}{110}{95}{95}{39}{58}]}{28 [{9}{112}{114}{105}{110}{116}{40}{39}{83}{116}{114}{105}{110}{103}{67}{104}{97}{114}{70}{101}{97}{116}{117}{114}{101}{115}{39}{41}]}{49 [{9}{102}{101}{97}{116}{117}{114}{101}{115}{95}{115}{116}{114}{105}{110}{103}{95}{99}{104}{97}{114}{95}{109}{111}{100}{117}{108}{97}{114}{40}{42}{112}{97}{114}{97}{109}{101}{116}{101}{114}{95}{108}{105}{115}{116}{91}{48}{93}{41}]})\u000asingle_string Vector<char> 0 ()\u000amax_string_length int32 57\u000anum_symbols floatmax 256\u000aoriginal_num_symbols floatmax 256\u000aorder int32 0\u000apreprocess_on_get bool f\u000amask_table Vector<char> 0 ()\u000a
p28
Vlatin1
p29
tp30
Rp31
tp32
btp33
.