<p>I think this behavior can adjust from map policies.</p>
<pre><code>//please give it a better name if you can
class IncrementSpecificTargetPolicy
{
public:
typedef size_t mapped_type;
explicit IncrementSpecificTargetPolicy(std::set<std::string> specificString) :
specificString(std::move(specificString)) {}
template <typename MapType>
mapped_type MapString(MapType& maps,
std::vector<Datatype>& types,
const std::string& string,
const size_t dimension)
{
// If this condition is true, either we have no mapping for the given string
// or we have no mappings for the given dimension at all. In either case,
// we create a mapping.
if (specificString.count(string) != 0 && (maps.count(dimension) == 0 ||
maps[dimension].first.left.count(string) == 0))
{
//do your jobs
}
}
private:
std::set<std::string> specificString;
}; // class IncrementPolicy
</code></pre>
<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/mlpack/mlpack/pull/694#issuecomment-229226017">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe/AJ4bFIyR6eXNEvVLPOKc-NDCFmWjRFDoks5qQcA3gaJpZM4I07W-">mute the thread</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/AJ4bFGIcKL2g-vYYl2p2rlkwvmJylf3Nks5qQcA3gaJpZM4I07W-.gif" width="1" /></p>
<div itemscope itemtype="http://schema.org/EmailMessage">
<div itemprop="action" itemscope itemtype="http://schema.org/ViewAction">
<link itemprop="url" href="https://github.com/mlpack/mlpack/pull/694#issuecomment-229226017"></link>
<meta itemprop="name" content="View Pull Request"></meta>
</div>
<meta itemprop="description" content="View this Pull Request on GitHub"></meta>
</div>