Skip to content
Snippets Groups Projects
Commit df87cab9 authored by ilor's avatar ilor
Browse files

Merge branch 'master' of nlp.pwr.wroc.pl:wccl

parents fd891280 0e2d3643
No related merge requests found
...@@ -33,13 +33,13 @@ boost::shared_ptr<StrSet> Lexicon::translate(const StrSet& set) const ...@@ -33,13 +33,13 @@ boost::shared_ptr<StrSet> Lexicon::translate(const StrSet& set) const
void Lexicon::insert(const UnicodeString& key, const UnicodeString& value) void Lexicon::insert(const UnicodeString& key, const UnicodeString& value)
{ {
if (has_key(key)) { if (has_key(key)) {
throw InvalidArgument("key", PwrNlp::to_utf8(key) + " - entry already added."); throw InvalidArgument("key", "Duplicated key in lexicon: " + PwrNlp::to_utf8(key));
} }
if (key.isEmpty()) { if (key.isEmpty()) {
throw InvalidArgument("key", "Cannot add an empty string."); throw InvalidArgument("key", "Empty key string in lexicon.");
} }
if (value.isEmpty()) { if (value.isEmpty()) {
throw InvalidArgument("value", "Cannot add an empty string."); throw InvalidArgument("value", "Empty value string in lexicon.");
} }
map_[key] = value; map_[key] = value;
} }
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment