From 2380e8ea08bc385cab6fb163a43b111ea4196ebd Mon Sep 17 00:00:00 2001 From: ilor <kailoran@gmail.com> Date: Mon, 20 Jun 2011 13:25:34 +0200 Subject: [PATCH] re-add nonconst tokens() accesor. Fix indentation --- libcorpus2/sentence.h | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/libcorpus2/sentence.h b/libcorpus2/sentence.h index e4d2ee6..ddbb704 100644 --- a/libcorpus2/sentence.h +++ b/libcorpus2/sentence.h @@ -39,28 +39,28 @@ namespace Corpus2 { class Sentence : private boost::noncopyable { public: - /// Convenience typedef for a shared pointer to a Sentence + /// Convenience typedef for a shared pointer to a Sentence typedef boost::shared_ptr<Sentence> Ptr; - /// Convenience typedef for a shared pointer to a const Sentence + /// Convenience typedef for a shared pointer to a const Sentence typedef boost::shared_ptr<const Sentence> ConstPtr; /// Empty constructor. Creates a Sentence with no tokens. Sentence(); - /// Sentence cloning. All the tokens are duplicated. + /// Sentence cloning. All the tokens are duplicated. virtual Ptr clone_shared() const; /// Destructor. Deletes contained tokens. virtual ~Sentence(); - /// Releases ownership of all tokens, makes the sentence empty. - /// Warning: This will cause an obvious memory leak if the tokens are - /// not stored somewhere first (e.g. append()ed to another Sentence). + /// Releases ownership of all tokens, makes the sentence empty. + /// Warning: This will cause an obvious memory leak if the tokens are + /// not stored somewhere first (e.g. append()ed to another Sentence). void release_tokens(); /// Convenience function to check if the sentence is empty - bool empty() const { + bool empty() const { return tokens_.empty(); } @@ -95,9 +95,9 @@ public: } /// Underlying vector accessor, nonconst (dangerous) - //std::vector<Token*>& tokens() { - // return tokens_; - //} + std::vector<Token*>& tokens() { + return tokens_; + } /// Helper function for appending tokens. Prefer using this. /// Might be overriden in a child class to make adding a token keep -- GitLab