19 using namespace shogun;
63 substring example_string = {line, line + num_chars};
69 tokenize(
'|', example_string, channels);
75 feature_start = &channels[0];
81 if (tab_location != label_space.
end)
82 label_space.
start = tab_location+1;
99 for (
substring* i = feature_start; i != channels.
end; i++)
113 bool new_index =
false;
116 if (channel.
start[0] !=
' ')
122 if (name.
index() > 0)
124 index = (
unsigned char)(*name[0].start);
136 index = (
unsigned char)
' ';
174 int32_t num_chars = buf->
read_line(line);
179 substring example_string = {line, line + num_chars};
182 tokenize(
' ', example_string, words);
216 int32_t num_chars = buf->
read_line(line);
221 substring example_string = {line, line + num_chars};
224 tokenize(
' ', example_string, words);
257 char* file_name = fname;
258 char default_cache_name[] =
"vw_cache.dat.cache";
261 file_name = default_cache_name;
272 SG_ERROR(
"Protocol buffers cache support is not implemented yet.\n");
275 SG_ERROR(
"Unexpected cache type specified!\n");
283 switch (feat_name.
index())
293 SG_SERROR(
"error NaN value for feature %s! Terminating!\n",
297 SG_SERROR(
"Examples with a weird name, i.e., '%s'\n",
305 char *last = s.
start;
308 if (*s.
start == delim)