19 using namespace shogun;
56 substring example_string = {line, line + num_chars};
62 tokenize(
'|', example_string, channels);
68 feature_start = &channels[0];
74 if (tab_location != label_space.
end)
75 label_space.
start = tab_location+1;
92 for (
substring* i = feature_start; i != channels.
end; i++)
106 bool new_index =
false;
109 if (channel.
start[0] !=
' ')
115 if (name.
index() > 0)
117 index = (
unsigned char)(*name[0].start);
129 index = (
unsigned char)
' ';
167 int32_t num_chars = buf->
read_line(line);
172 substring example_string = {line, line + num_chars};
175 tokenize(
' ', example_string, words);
209 int32_t num_chars = buf->
read_line(line);
214 substring example_string = {line, line + num_chars};
217 tokenize(
' ', example_string, words);
250 char* file_name = fname;
251 char default_cache_name[] =
"vw_cache.dat.cache";
254 file_name = default_cache_name;
265 SG_ERROR(
"Protocol buffers cache support is not implemented yet.\n")
268 SG_ERROR(
"Unexpected cache type specified!\n")
276 switch (feat_name.
index())
286 SG_SERROR(
"error NaN value for feature %s! Terminating!\n",
290 SG_SERROR(
"Examples with a weird name, i.e., '%s'\n",
298 char *last = s.
start;
301 if (*s.
start == delim)