Skip to content
Snippets Groups Projects
Commit cd7f2466 authored by Adam Wardynski's avatar Adam Wardynski
Browse files

Add lexicons to WcclFile.

parent f1d0815d
No related branches found
No related tags found
No related merge requests found
......@@ -8,6 +8,7 @@
#include <libwccl/values/tset.h>
#include <libwccl/wcclfileopsections.h>
#include <libwccl/ops/tagrulesequence.h>
#include <libwccl/lexicon/lexicons.h>
namespace Wccl {
......@@ -72,6 +73,11 @@ public:
FunctionalOpSequence::name_op_v_t gen_all_op_pairs();
FunctionalOpSequence::name_op_v_c_t gen_all_op_pairs() const;
void import_lexicon(const boost::shared_ptr<Lexicon>& lexicon);
bool has_lexicon(const std::string& name) const;
boost::shared_ptr<const Lexicon> get_lexicon_ptr(const std::string& name) const;
const Lexicon& get_lexicon(const std::string& name) const;
void add_untyped_section(const boost::shared_ptr<UntypedOpSequence>& section);
void add_untyped_section(const boost::shared_ptr<const UntypedOpSequence>& section);
void add_untyped_section(const UntypedOpSequence& section);
......@@ -98,6 +104,7 @@ private:
std::ostream& write_to(std::ostream& ostream) const;
std::vector<boost::shared_ptr<FunctionalOpSequence> > all_sections_;
boost::shared_ptr<TagRuleSequence> tag_rules_;
boost::shared_ptr<Lexicons> lexicons_;
const Corpus2::Tagset& tagset_;
};
......@@ -277,6 +284,30 @@ typename OpSequence<T>::name_op_v_c_t WcclFile::gen_name_op_pairs() const
return WcclFileOpSections<OpSequence<T> >::gen_name_op_pairs();
}
inline
void WcclFile::import_lexicon(const boost::shared_ptr<Lexicon>& lexicon)
{
lexicons_->insert(lexicon);
}
inline
bool WcclFile::has_lexicon(const std::string& name) const
{
return lexicons_->has_lexicon(name);
}
inline
boost::shared_ptr<const Lexicon> WcclFile::get_lexicon_ptr(const std::string& name) const
{
return lexicons_->get_ptr(name);
}
inline
const Lexicon& WcclFile::get_lexicon(const std::string &name) const
{
return lexicons_->get(name);
}
inline
void WcclFile::add_untyped_section(const boost::shared_ptr<UntypedOpSequence>& section)
{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment