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

Some rough comments to WcclFile header.

parent cd7e633b
Branches
No related merge requests found
......@@ -15,6 +15,12 @@
namespace Wccl {
/**
* Class representing contents of parsed WCCL files
* - imported lexicons, any typed and untyped named
* operator sections, up to one tag rules section,
* and up to one match rules section.
*/
class WcclFile
: WcclFileOpSections<UntypedOpSequence>,
WcclFileOpSections<OpSequence<StrSet> >,
......@@ -26,6 +32,9 @@ class WcclFile
public:
WcclFile(const Corpus2::Tagset& tagset, const std::string& search_path);
//
// Untyped and typed operator sections: @X:"sectioname" ( op1; op2 )
//
const std::vector<boost::shared_ptr<UntypedOpSequence> >& untyped_sections();
template<class T>
const typename std::vector<boost::shared_ptr<OpSequence<T> > >& sections();
......@@ -76,14 +85,6 @@ 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;
bool has_lexicons() const;
boost::shared_ptr<const Lexicon> get_lexicon_ptr(const std::string& name) const;
const Lexicon& get_lexicon(const std::string& name) const;
boost::shared_ptr<const Lexicons> get_lexicons_ptr() const;
const Lexicons& get_lexicons() 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);
......@@ -94,6 +95,20 @@ public:
template<class T>
void add_section(const OpSequence<T>& section);
//
// Lexicons, import sections: import("path", "name")
//
void import_lexicon(const boost::shared_ptr<Lexicon>& lexicon);
bool has_lexicon(const std::string& name) const;
bool has_lexicons() const;
boost::shared_ptr<const Lexicon> get_lexicon_ptr(const std::string& name) const;
const Lexicon& get_lexicon(const std::string& name) const;
boost::shared_ptr<const Lexicons> get_lexicons_ptr() const;
const Lexicons& get_lexicons() const;
//
// Tag rules section: tag_rules ( rule1; rule2 )
//
bool has_tag_rules() const;
void set_tag_rules(const boost::shared_ptr<TagRuleSequence>& tag_rules);
......@@ -102,10 +117,16 @@ public:
boost::shared_ptr<TagRuleSequence> get_tag_rules_ptr();
boost::shared_ptr<const TagRuleSequence> get_tag_rules_ptr() const;
//
// Match rules section: match_rules ( apply1; apply2 )
//
bool has_match_rules() const;
void add_match_rule(const boost::shared_ptr<MatchRule>& match_rule);
const std::vector<boost::shared_ptr<MatchRule> >& get_match_rules();
//
// Miscelaneous
//
friend std::ostream& operator<<(std::ostream& ostream, const WcclFile& wccl_file);
std::string to_string() const;
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment