[idf description]
@param  {String} term
@return {Number}
772033
function( term ) {
    
    var document_count
    var appearances = 1
    
    for( key in this.documents ) {
      this.documents[ key ][ term ]
        ? appearances++ : 0
    }
    
    document_count = Object.keys( this.documents )
    document_count = document_count.length + 1
    
    return Math.log( document_count / appearances )
    
  }
1154232
private List<WComponent> getComponentsForTerm(final String term) {
		List<WComponent> childList = content.getComponentModel().getChildren();
		List<WComponent> result = new ArrayList<>();

		if (childList != null) {
			for (int i = 0; i < childList.size(); i++) {
				WComponent child = childList.get(i);

				if (term.equals(child.getTag())) {
					result.add(child);
				}
			}
		}

		return result;
	}
1091877
def _term(g):
    """"""
    all_t = {x for rule in g.rules for x in rule.rhs if isinstance(x, T)}
    t_rules = {t: Rule(NT('__T_%s' % str(t)), [t], weight=0, alias='Term') for t in all_t}
    new_rules = []
    for rule in g.rules:
        if len(rule.rhs) > 1 and any(isinstance(x, T) for x in rule.rhs):
            new_rhs = [t_rules[x].lhs if isinstance(x, T) else x for x in rule.rhs]
            new_rules.append(Rule(rule.lhs, new_rhs, weight=rule.weight, alias=rule.alias))
            new_rules.extend(v for k, v in t_rules.items() if k in rule.rhs)
        else:
            new_rules.append(rule)
    return Grammar(new_rules)
241846
def get_term(self,term_id):
        
        if term_id in self.idx:
            return Cterm(self.idx[term_id],self.type)
        else:
            return None
816085
function( term ) {
        var split_term = term.split(' ');
        var matchers = [];
        for (var i=0; i < split_term.length; i++) {
          if ( split_term[i].length > 0 ) {
            var matcher = {};
            matcher['partial'] = new RegExp( $.ui.autocomplete.escapeRegex( split_term[i] ), "i" );
            if ( context.settings['relevancy-sorting'] ) {
              matcher['strict'] = new RegExp( "^" + $.ui.autocomplete.escapeRegex( split_term[i] ), "i" );
            }
            matchers.push( matcher );
          }
        };

        return $.grep( context.options, function( option ) {
          var partial_matches = 0;
          if ( context.settings['relevancy-sorting'] ) {
            var strict_match = false;
            var split_option_matches = option.matches.split(' ');
          }
          for ( var i=0; i < matchers.length; i++ ) {
            if ( matchers[i]['partial'].test( option.matches ) ) {
              partial_matches++;
            }
            if ( context.settings['relevancy-sorting'] ) {
              for (var q=0; q < split_option_matches.length; q++) {
                if ( matchers[i]['strict'].test( split_option_matches[q] ) ) {
                  strict_match = true;
                  break;
                }
              };
            }
          };
          if ( context.settings['relevancy-sorting'] ) {
            var option_score = 0;
            option_score += partial_matches * context.settings['relevancy-sorting-partial-match-value'];
            if ( strict_match ) {
              option_score += context.settings['relevancy-sorting-strict-match-value'];
            }
            option_score = option_score * option['relevancy-score-booster'];
            option['relevancy-score'] = option_score;
          }
          return (!term || matchers.length === partial_matches );
        });
      }
668177
function (id, length) {
            length = length || 8;

            id = id || words.generate(length);

            while (this.mapValues[id] !== undefined) {
                id = words.generate(length);
                length += 1;
            }

            return id.toString();
        }
75823
function intLength(num) {
		num = num.replace(/^\-/, '');
		if (~num.indexOf('.')) {
			return num.split('.')[0].length;
		}
		
		return num.length;
	}
638640
function toFunction(term){
    return eval(transmogrify(
      function(varName, body){ return "(function("+varName+"){return "+body+"})"; },
      function(fun, arg){ return fun+"("+arg+")"; })
      (term));
  }
952183
def term_frequency(document, term)
      tf = document.term_count(term)
      (tf * 2.2) / (tf + 0.3 + 0.9 * documents.size / @model.average_document_size)
    end
643018
function (term) {
    return this.get('/storesearch', {
      // 'cc': this.options.country,
      // 'l': this.options.language
      'term': term
    }).then(function (body) {
      var items = body.items;
      return Promise.resolve(items);
    });
  }
1148170
function(item, term) {
            var numContextWords = 2;
            var text = item.content.match(
                "(?:\\s?(?:[\\w]+)\\s?){0,"+numContextWords+"}" +
                    term+"(?:\\s?(?:[\\w]+)\\s?){0,"+numContextWords+"}");
            item.context = text;
            return '<div class="autocomplete-suggestion" ' +
                'data-term="' + term + '" ' +
                'data-title="' + item.title + '" ' +
                'data-uri="'+ item.uri + '" ' +
                'data-context="' + item.context + '">' +
                '» ' + item.title +
                '<div class="context">' +
                (item.context || '') +'</div>' +
                '</div>';
        }
309882
function currentWord(x) {
    if ((x.b.data.wordWindow["0"] === token) &&
        (x.a === tag)) {
        return 1;
    }
    return 0;
  }
25161
function getWordToken(str) {
    var word = str.split(/\s/g)[0];
    return {text: word, type: 'WORD', length: word.length};
}
271269
def get_term(self, term, value=False):
        """"""
        return self.doc.find_first(term, value=value, section=self.name)
1257141
def term_regex(term):
    
    return re.compile(r'^{0}$'.format(re.escape(term)), re.IGNORECASE)
1242910
public static int getTermFrequency(String term)
    {
        Attribute attribute = get(term);
        if (attribute == null) return 0;
        return attribute.totalFrequency;
    }
303202
function getDefinition( content ) {

  var definition = { };
  var lines = content.html.split( '\n' );

  // Starts with menu info?
  if (lines.length && lines[ 0 ].substring( 0, 4 ) === '<!--') {

    var line = lines.shift();
    var canDo = true;
    var key;

    // Build content definition.
    do {
      line = lines.shift();
      // End of definition?
      if (!line || /-->/.test( line ) )
        canDo = false;
      // Comment?
      else if (line.substring( 0, 3 ) === '---') {
        // Skip this line.
      } else if (line.substring( 0, 3 ) === '   ') {
        // Continue previous item?
        if (key)
          definition[ key ] = definition[ key ].trim() + ' ' + line.substring( 3 ).trim();
      }
      // New key-value pair?
      else {
        var pair = line.split( ':' );
        if (pair.length > 1) {
          key = pair[ 0 ].trim();
          definition[ key ] = pair[ 1 ].trim();
        }
      }
    } while (canDo);

    // Remove the definition part from the content text.
    content.html = lines.join( '\n' );
  }

  // Return the metadata.
  return new Metadata( definition, content.path );
}