createSynonymsRegExp(str) {
    const syn = this.opt.synonyms,
      sens = this.opt.caseSensitive ? '' : 'i',
      // add replacement character placeholder before and after the
      // synonym group
      joinerPlaceholder = this.opt.ignoreJoiners ||
      this.opt.ignorePunctuation.length ? '\u0000' : '';
    for (let index in syn) {
      if (syn.hasOwnProperty(index)) {
        let keys = Array.isArray(syn[index]) ? syn[index] : [syn[index]];
        keys.unshift(index);
        keys = this.sortByLength(keys).map(key => {
          if (this.opt.wildcards !== 'disabled') {
            key = this.setupWildcardsRegExp(key);
          }
          key = this.escapeStr(key);
          return key;
        }).filter(k => k !== '');
        if (keys.length > 1) {
          str = str.replace(
            new RegExp(
              `(${keys.map(k => this.escapeStr(k)).join('|')})`,
              `gm${sens}`
            ),
            joinerPlaceholder +
            `(${keys.map(k => this.processSynonyms(k)).join('|')})` +
            joinerPlaceholder
          );
        }
      }
    }
    return str;
  }
Creates a regular expression string to match the defined synonyms
@param  {string} str - The search term to be used
@return {string}