code: function tags(data) {
          // TODO even for a function we should probably return a wrapper that does the same object/string check as
          // the function for arrays. otherwise only functions that return objects are supported.
          if ($.isFunction(data)) {
              return data;
          }
  
          // if not a function we assume it to be an array
  
          return function (query) {
              var t = query.term, filtered = {results: []};
              $(data).each(function () {
                  var isObject = this.text !== undefined,
                      text = isObject ? this.text : this;
                  if (t === "" || query.matcher(t, text)) {
                      filtered.results.push(isObject ? this : {id: this, text: this});
                  }
              });
              query.callback(filtered);
          };
      }
docs: TODO javadoc