Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/moses-smt/vowpal_wabbit.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichelangelo D'Agostino <mdagostino@civisanalytics.com>2014-03-26 00:56:10 +0400
committerMichelangelo D'Agostino <mdagostino@civisanalytics.com>2014-03-26 00:56:10 +0400
commitbcdea936c38fbcc202029103c55d887e7810fee2 (patch)
tree496fbe8ff03029e21a7837d1c85fb3fa347b24e5 /vowpalwabbit/parse_args.cc
parentb1ed09467992a3598ff904a3842b645b908a0396 (diff)
The : wildcard for quadratic interactions doesn't seem to work on Mac. Fixed with stringstreams.
Diffstat (limited to 'vowpalwabbit/parse_args.cc')
-rw-r--r--vowpalwabbit/parse_args.cc15
1 files changed, 11 insertions, 4 deletions
diff --git a/vowpalwabbit/parse_args.cc b/vowpalwabbit/parse_args.cc
index 5ebde865..f13edd15 100644
--- a/vowpalwabbit/parse_args.cc
+++ b/vowpalwabbit/parse_args.cc
@@ -5,6 +5,7 @@ license as described in the file LICENSE.
*/
#include <stdio.h>
#include <float.h>
+#include <sstream>
#include "cache.h"
#include "io_buf.h"
@@ -565,8 +566,11 @@ vw* parse_args(int argc, char *argv[])
else if((*i)[0]==':'&&(*i)[1]!=':'){
newpairs.reserve(newpairs.size() + valid_ns_size);
for (char j=printable_start; j<=printable_end; j++){
- if(valid_ns(j))
- newpairs.push_back(string(&j)+(*i)[1]);
+ if(valid_ns(j)){
+ stringstream ss;
+ ss << j << (*i)[1];
+ newpairs.push_back(ss.str());
+ }
}
}
//-q ::
@@ -575,8 +579,11 @@ vw* parse_args(int argc, char *argv[])
for (char j=printable_start; j<=printable_end; j++){
if(valid_ns(j)){
for (char k=printable_start; k<=printable_end; k++){
- if(valid_ns(k))
- newpairs.push_back(string(&j)+k);
+ if(valid_ns(k)){
+ stringstream ss;
+ ss << j << k;
+ newpairs.push_back(ss.str());
+ }
}
}
}