<commit_before>#ifndef _TYPENAME_HH_
#define _TYPENAME_HH_

#include <cstddef>
#include <deque>
#include <string>
#include <utility>

typedef struct TypenameEntry {
	std::string name;
	int category;
	std::string nspace;

	TypenameEntry(std::string name, int cat, std::string nspace = "") {
		this->name = name;
		this->category = cat;
		this->nspace = nspace;
	}
} TypenameEntry;

class TypenameTable {
private:
	static const size_t HASHTABLE_SIZE = 137;
	std::deque<TypenameEntry> bucket[HASHTABLE_SIZE];
	std::size_t hash(std::string name);
public:
	bool insert(std::string name, int cat, std::string nspace = "");
	int lookup(std::string name);
	std::pair<int,std::string> lookup_namespace(std::string name);
	TypenameEntry get_entry(std::string name);
};

/*
 * Direct comparison operators for between TypenameEntry objects and either 
 * other TypenameEntry objects or std::strings directly.
 */
inline bool operator==(const TypenameEntry& lhs, const std::string& rhs) { 
	return (lhs.name == rhs);
}
inline bool operator!=(const TypenameEntry& lhs, const std::string& rhs) { 
	return !(lhs.name == rhs);
}
inline bool operator==(const TypenameEntry& lhs, const TypenameEntry& rhs) { 
	return (lhs == rhs.name);
}
inline bool operator!=(const TypenameEntry& lhs, const TypenameEntry& rhs) { 
	return !(lhs == rhs.name);
}



#endif /* _TYPENAME_HH_ */<commit_msg>Added size of object (in bytes) to Typename entry -- need to actually use however)<commit_after>#ifndef _TYPENAME_HH_
#define _TYPENAME_HH_

#include <cstddef>
#include <deque>
#include <string>
#include <utility>

typedef struct TypenameEntry {
	std::string name;
	int category;
	std::string nspace;
	std::size_t size;

	TypenameEntry(std::string n, int c, std::string ns = "",
						std::size_t s = 8)
			: name(n), category(c), nspace(ns), size(s) {}
} TypenameEntry;

class TypenameTable {
private:
	static const size_t HASHTABLE_SIZE = 137;
	std::deque<TypenameEntry> bucket[HASHTABLE_SIZE];
	std::size_t hash(std::string name);
public:
	bool insert(std::string name, int cat, std::string nspace = "");
	int lookup(std::string name);
	std::pair<int,std::string> lookup_namespace(std::string name);
	TypenameEntry get_entry(std::string name);
};

/*
 * Direct comparison operators for between TypenameEntry objects and either 
 * other TypenameEntry objects or std::strings directly.
 */
inline bool operator==(const TypenameEntry& lhs, const std::string& rhs) { 
	return (lhs.name == rhs);
}
inline bool operator!=(const TypenameEntry& lhs, const std::string& rhs) { 
	return !(lhs.name == rhs);
}
inline bool operator==(const TypenameEntry& lhs, const TypenameEntry& rhs) { 
	return (lhs == rhs.name);
}
inline bool operator!=(const TypenameEntry& lhs, const TypenameEntry& rhs) { 
	return !(lhs == rhs.name);
}



#endif /* _TYPENAME_HH_ */
{'fraction_non_alphanumeric': 0.13712255772646537, 'fraction_numerical': 0.002486678507992895, 'mean_word_length': 5.5488372093023255, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 18, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3541893', 'n_tokens_mistral': 980, 'n_tokens_neox': 933, 'n_words': 266}