(function () {
var p = adventurejs.Dictionary.prototype;
p.testVerbSynonyms = function Dictionary_testVerbSynonyms(word1, word2) {
var prop, testword;
if (word1 === word2) {
return true;
}
if ("string" !== typeof word1 || "string" !== typeof word2) {
console.warn(
"synonyms function takes two strings, but received:",
word1,
word2
);
return false;
}
if (
"undefined" === typeof this.verb_lookup[word1] &&
"undefined" === typeof this.verb_lookup[word2]
) {
console.warn(
"Neither " + word1 + " nor " + word2 + " were found in the dictionary."
);
return false;
}
if (
"undefined" !== typeof this.verb_lookup[word1] &&
"undefined" !== typeof this.verb_lookup[word2]
) {
return false;
}
if ("undefined" === typeof this.verb_lookup[word1]) {
testword = word1;
prop = word2;
} else {
testword = word2;
prop = word1;
}
var synonyms = this.verb_lookup[prop].synonyms;
if ("undefined" === typeof synonyms) return false;
for (var i = 0; i < synonyms.length; i++) {
if (testword === synonyms[i]) {
return prop;
}
}
return false;
};
})();