diff --git a/libcorpus2/tagset.cpp b/libcorpus2/tagset.cpp index 5f86203bd1ce1ca20034770f577636be4b53fef9..538d2c240a764256ec904bd25caa4f3a73c0fc43 100644 --- a/libcorpus2/tagset.cpp +++ b/libcorpus2/tagset.cpp @@ -73,12 +73,11 @@ Tagset::Tagset() { } -Tagset::Tagset(const char *s) - : id_(++next_id_) +Tagset Tagset::from_data(const char *s) { std::stringstream ss; ss << s; - *this = TagsetParser::load_ini(ss); + return TagsetParser::load_ini(ss); } std::string Tagset::id_string() const diff --git a/libcorpus2/tagset.h b/libcorpus2/tagset.h index 88b0aa21a1c89b0695369c40d9042d2417c745e3..44cfbf25bb4effbc1906e070ef545cc57a1a7d2b 100644 --- a/libcorpus2/tagset.h +++ b/libcorpus2/tagset.h @@ -99,10 +99,10 @@ public: Tagset(); /** - * Tagset convenience constructor, parse a string as if it were the + * Tagset convenience creation function, parse a string as if it were the * contents of a tagset ini file */ - explicit Tagset(const char*); + static Tagset from_data(const char*); /** * Tag parsing -- functional version, whole tag string.