Skip to content

Commit

Permalink
Merge pull request #234 from sploving/master
Browse files Browse the repository at this point in the history
add lua string features modular
  • Loading branch information
Soeren Sonnenburg committed Jul 26, 2011
2 parents 05427ed + f5b05f4 commit 16fc2a1
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 16fc2a1

Please sign in to comment.