From 69dda1b7e630efa442cd7a52d8406ff563a19b3b Mon Sep 17 00:00:00 2001
From: ilor <kailoran@gmail.com>
Date: Wed, 27 Oct 2010 12:29:48 +0200
Subject: [PATCH] remove duplicate Tagset get_value_attribute_index function

---
 libcorpus2/tagset.cpp | 13 -------------
 libcorpus2/tagset.h   |  4 ----
 tagset-tool/main.cpp  |  2 +-
 3 files changed, 1 insertion(+), 18 deletions(-)

diff --git a/libcorpus2/tagset.cpp b/libcorpus2/tagset.cpp
index a4afb93..77b2260 100644
--- a/libcorpus2/tagset.cpp
+++ b/libcorpus2/tagset.cpp
@@ -491,19 +491,6 @@ const std::string& Tagset::get_value_name(mask_t v) const
 	}
 }
 
-idx_t Tagset::get_value_attribute_index(mask_t v) const
-{
-	std::map<mask_t, idx_t>::const_iterator ci;
-	ci = value_mask_to_attribute_index_.find(v);
-	if (ci == value_mask_to_attribute_index_.end()) {
-		return -1;
-	} else {
-		return ci->second;
-	}
-}
-
-
-
 idx_t Tagset::get_value_attribute(mask_t v) const
 {
 	std::map<mask_t, idx_t>::const_iterator ci;
diff --git a/libcorpus2/tagset.h b/libcorpus2/tagset.h
index 51bed03..b2d4dcf 100644
--- a/libcorpus2/tagset.h
+++ b/libcorpus2/tagset.h
@@ -319,10 +319,6 @@ public:
 	/// @returns empty string on invalid mask
 	const std::string& get_value_name(mask_t v) const;
 
-	/// Value mask -> attribute index
-	/// @returns -1 on invalid mask
-	idx_t get_value_attribute_index(mask_t v) const;
-
 
 	/// Getter for the pos -> valid attributes (in order) mapping
 	/// Valid attributes are both the required and optional attributes.
diff --git a/tagset-tool/main.cpp b/tagset-tool/main.cpp
index a9640ed..4ae2cdb 100644
--- a/tagset-tool/main.cpp
+++ b/tagset-tool/main.cpp
@@ -129,7 +129,7 @@ void tagset_query_cb(const Corpus2::Tagset& tagset, const std::string& s,
 		}
 		std::cout << "\n";
 	} else if (val.any()) {
-		Corpus2::idx_t a = tagset.get_value_attribute_index(val);
+		Corpus2::idx_t a = tagset.get_value_attribute(val);
 		if (internals) {
 			std::cout << val << " (" << PwrNlp::lowest_bit(val) << ")\n";
 			std::cout << tagset.get_attribute_mask(a) << " (" << (int)a << ")\n";
-- 
GitLab