Skip to content

Commit

Permalink
add string features lua example
Browse files Browse the repository at this point in the history
  • Loading branch information
sploving committed Jul 26, 2011
1 parent ad8130a commit f5b05f4
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions examples/undocumented/lua_modular/features_string_char_modular.lua
@@ -0,0 +1,25 @@
require 'shogun'
require 'load'

strings = {'hey','guys','i','am','a','string'}
parameter_list={{{strings}}}

function features_string_char_modular(strings)

f=StringCharFeatures(strings, RAWBYTE)

print("max string length" ..f:get_max_vector_length())
--print "number of strings", f:get_num_vectors()
--print "length of first string", f:get_vector_length(0)
--print "strings", f.get_features()

f:set_feature_vector({'t','e','s','t'}, 0)

print ("strings" .. f:get_features())
return f:get_features(), f
end

if debug.getinfo(3) == nill then
print 'StringCharFeatures'
features_string_char_modular(unpack(parameter_list[1]))
end

0 comments on commit f5b05f4

Please sign in to comment.