text: 'use strict';
  
  const transforms = Terms => {
    const methods = {
      clone: function() {
        // this.world = this.world.clone();
        let terms = this.terms.map(t => {
          return t.clone();
        });
        return new Terms(terms, this.world, this.refText, null); //, this.refTerms
      },
      hyphenate: function() {
        this.terms.forEach((t, i) => {
          if (i !== this.terms.length - 1) {
            t.whitespace.after = '-';
          }
          if (i !== 0) {
            t.whitespace.before = '';
          }
        });
        return this;
      },
      dehyphenate: function() {
        this.terms.forEach(t => {
          if (t.whitespace.after === '-') {
            t.whitespace.after = ' ';
          }
        });
        return this;
      },
      trim: function() {
        if (this.length <= 0) {
          return this;
        }
        this.terms[0].whitespace.before = '';
        this.terms[this.terms.length - 1].whitespace.after = '';
        return this;
      }
    };
  
    //hook them into result.proto
    Object.keys(methods).forEach(k => {
      Terms.prototype[k] = methods[k];
    });
    return Terms;
  };
  
  module.exports = transforms;
  