diff --git a/libcorpus2/tagsetmanager.cpp b/libcorpus2/tagsetmanager.cpp index 4f7afef928237eb14981a417074958b4a91a070a..610234f7449f30358d022c11febec0693727ba36 100644 --- a/libcorpus2/tagsetmanager.cpp +++ b/libcorpus2/tagsetmanager.cpp @@ -21,6 +21,7 @@ or FITNESS FOR A PARTICULAR PURPOSE. #include <fstream> #include <iostream> #include <sstream> +#include <boost/algorithm/string/join.hpp> namespace Corpus2 { @@ -96,4 +97,9 @@ boost::shared_ptr<Tagset> TagsetManager::get_cache_entry(tagset_idx_t id) } } +std::string available_tagsets() +{ + return boost::algorithm::join(Path::Instance().list_files(".tagset"), " "); +} + } /* end ns Corpus2 */ diff --git a/libcorpus2/tagsetmanager.h b/libcorpus2/tagsetmanager.h index 356541f09202c84481121eea75ea72c875932c76..a5dc06422a97e9cfdb13b968c1fc27076ffb1ee1 100644 --- a/libcorpus2/tagsetmanager.h +++ b/libcorpus2/tagsetmanager.h @@ -81,6 +81,8 @@ inline const Tagset& get_named_tagset(tagset_idx_t id) { return TagsetManagerSingleton::Instance().get_tagset(id); } +std::string available_tagsets(); + } /* end ns Corpus2 */ #endif // LIBCORPUS2_TAGSETMANAGER_H diff --git a/tagset-tool/main.cpp b/tagset-tool/main.cpp index f3fa15f49f34ce0c376f0f69238c77468385edfb..9286269400c1f870f06ba9683b49912354a5526a 100644 --- a/tagset-tool/main.cpp +++ b/tagset-tool/main.cpp @@ -240,6 +240,8 @@ int main(int argc, char** argv) if (vm.count("help")) { std::cout << desc << "\n"; + std::cout << "Available tagsets: "; + std::cout << Corpus2::available_tagsets() << "\n"; return 1; }