<commit_before>'use strict';


/*
  We calculate the similarity between an experimental spectrum and a specific XY
 */


var Similarity = require('peaks-similarity');

function SimilarityProcessor(experimental, options) {
    // we will copy the options to be sure ...
    this.options=Object.create(options || {});

    this.widthFunction=undefined;
    if (this.options.widthFunction) {
        // we will create a function
        var theFunction="";
        if (this.options.widthBottom) theFunction+="var widthBottm="+widthBottm+";";
        if (this.options.widthTop) theFunction+="var widthTop="+widthTop+";";
        theFunction+=this.options.widthFunction;
        theFunction+=";"
        theFunction+="return {widthBottom: widthBottom, widthTop: widthTop};";

         this.widthFunction = new Function('mass', 'charge', theFunction);
    }

    this.similarity = new Similarity({
        widthTop: this.options.widthTop,<commit_msg>Update fix to add return<commit_after>'use strict';


/*
  We calculate the similarity between an experimental spectrum and a specific XY
 */


var Similarity = require('peaks-similarity');

function SimilarityProcessor(experimental, options) {
    // we will copy the options to be sure ...
    this.options=Object.create(options || {});

    this.widthFunction=undefined;
    if (this.options.widthFunction) {
        // we will create a function
        theFunction=[];
        if (this.options.widthBottom) theFunction.push("var widthBottm="+widthBottm+";");
        if (this.options.widthTop) theFunction.push("var widthTop="+widthTop+";");
        theFunction.push(this.options.widthFunction);
        theFunction.push(";");
        theFunction.push("return {widthBottom: widthBottom, widthTop: widthTop};");

         this.widthFunction = new Function('mass', 'charge', theFunction.join("\r\n"));
    }

    this.similarity = new Similarity({
        widthTop: this.options.widthTop,
{'fraction_non_alphanumeric': 0.13185108583247157, 'fraction_numerical': 0.0, 'mean_word_length': 3.5, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1330793', 'n_tokens_mistral': 545, 'n_tokens_neox': 528, 'n_words': 130}