code: function augmentContext1(context, oRules, options) {
      var sKey = oRules[0].key;
      // check that rule
      if (debuglog.enabled) {
          // check consistency
          oRules.every(function (iRule) {
              if (iRule.key !== sKey) {
                  throw new Error("Inhomogenous keys in rules, expected " + sKey + " was " + JSON.stringify(iRule));
              }
              return true;
          });
      }
      // look for rules which match
      var res = oRules.map(function (oRule) {
          // is this rule applicable
          switch (oRule.type) {
              case mgnlq_model_1.IFModel.EnumRuleType.WORD:
                  return matchWord(oRule, context, options);
              case mgnlq_model_1.IFModel.EnumRuleType.REGEXP:
                  return matchRegExp(oRule, context, options);
          }
          return undefined;
      }).filter(function (ores) {
          return !!ores;
      }).sort(sortByWeight.bind(this, sKey));
      //debuglog("hassorted" + JSON.stringify(res,undefined,2));
      return res;
      // Object.keys().forEach(function (sKey) {
      // });
  }
docs: Word, Synonym, Regexp / ExtractionRule