-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added Convert Function as discussed on Issue#22 #33
base: master
Are you sure you want to change the base?
Conversation
Thanks for opening your first pull request in this repository! Someone will review it when they have a chance. In the mean time, please be sure that you've handled the following things, to make the review process quicker and easier:
Thank you again for your contributions! 👍 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @heisenbuug, Thanks a lot for working on this. I've left some style comments other than that it looks good to me.
Could you also add tests for this, we can download files from the net during runtime using utils in models repo (Refer other tests). Again, Thanks for working on this. 👍
Co-authored-by: kartikdutt18 <[email protected]>
This issue has been automatically marked as stale because it has not had any recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions! 👍 |
Thanks for opening your first pull request in this repository! Someone will review it when they have a chance. In the mean time, please be sure that you've handled the following things, to make the review process quicker and easier:
Thank you again for your contributions! 👍 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @heisenbuug, Sorry I forgot about this PR. This looks promising, Let me know if you need any assistance. Thanks for this PR.
ctr++; | ||
} | ||
|
||
auto create_JSON(std::vector<std::string>& tags, std::vector<std::string> rows) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey, can we use camel case to be consistent.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@heisenbuug, Can I do it for you?
auto tokenize(std::string& line) | ||
{ | ||
std::vector<std::string> col_names; | ||
tokenizer<escaped_list_separator<char> > tk(line, escaped_list_separator<char>()); | ||
for (tokenizer<escaped_list_separator<char> >::iterator i(tk.begin()); i != tk.end(); ++i) | ||
col_names.push_back(*i); | ||
return col_names; | ||
} | ||
|
||
auto create_XML(std::vector<std::string>& tags, std::vector<std::string> rows) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think there is some issue with indentation. Also, can we replace auto with data type (makes it easier to figure out all properties).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@heisenbuug, Can I also do this?
using namespace boost::property_tree; | ||
using namespace boost; | ||
|
||
class Convert |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey, can we also add class description and usage here.
} | ||
|
||
public: | ||
void convert(std::string path, std::string to) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's make this function static. No need to declare an object for converting datasets. Also Capitalize the first letter of the function.
Hey @kartikdutt18, I will add json. xml -> csv by the end of today or tomorrow... |
Hey @kartikdutt18, I noticed something... Shouldn't we have to put all of them in 1 file? Also, we are planning to reduce boost dependencies, right? So should we use boost here? |
Issue link
Added a new folder dataset_utils and currently the convert function can convert