Skip to content
Snippets Groups Projects
Select Git revision
  • b9a600cc5864b93082cb2c13f8d19ab4cbac0df6
  • master default protected
  • develop protected
  • feat_remove_attr
  • python2.7
  • python3.8
6 results

tokenmetadata.h

Blame
  • tokenmetadata.h 1.23 KiB
    /*
        Copyright (C) 2010 Tomasz Śniatowski, Adam Radziszewski
        Part of the libcorpus2 project
    
        This program is free software; you can redistribute it and/or modify it
    under the terms of the GNU General Public License as published by the Free
    Software Foundation; either version 3 of the License, or (at your option)
    any later version.
    
        This program is distributed in the hope that it will be useful, but
    WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
    or FITNESS FOR A PARTICULAR PURPOSE. 
    
        See the LICENSE and COPYING files for more details.
    */
    
    #ifndef LIBCORPUS2_TOKENMETADATA_H
    #define LIBCORPUS2_TOKENMETADATA_H
    
    #include <string>
    #include <map>
    #include <boost/shared_ptr.hpp>
    
    namespace Corpus2 {
    
    
    /// Token metadata class
    class TokenMetaData
    {
    public:
    	TokenMetaData();
    
    	TokenMetaData* clone() const;
    
    	typedef std::map<std::string, std::string> attr_map_t;
    
    	bool has_attribute(const std::string& name) const;
    
    	std::string get_attribute(const std::string& name) const;
    
    	void set_attribute(const std::string& name, const std::string& value);
    
    	const attr_map_t& attributes() const {
    		return attributes_;
    	}
    
    private:
    	attr_map_t attributes_;
    };
    
    } /* end ns Corpus2 */
    
    #endif // LIBCORPUS2_TOKENMETADATA_H