<commit_before>'use strict';

var version = require("./package").version;
var config = require('./config/config');

var koa = require('koa');
var app = module.exports = koa();
var router = require('koa-router')();
var request = require('request-json');
var cors = require('koa-cors');


/////
// Logging (simple)
var winston = require('winston');

winston.add(winston.transports.File, {
    filename: `${__dirname***REMOVED***/logs/user_selected.log`,
    level: 'info',
    timestamp: true,
    handleExceptions: true
***REMOVED***);

// Only log it in log file
winston.remove(winston.transports.Console);


var logUserSelection = function *() {
***REMOVED*** - user_id=>environment (keeps it reasonably anonymous)
    var headers = this.req.headers;

***REMOVED*** User selected CUI (by clicking)
    var query   = this.request.body.query || "";

***REMOVED*** String used to create autocompletion suggestion list
    var user_typed = this.request.body.user_typed || "";

***REMOVED*** Pref. term of the clicked suggestion<commit_msg>New keyword fix<commit_after>'use strict';

var version = require("./package").version;
var config = require('./config/config');

var koa = require('koa');
var app = module.exports = new koa();
var router = require('koa-router')();
var request = require('request-json');
var cors = require('koa-cors');


/////
// Logging (simple)
var winston = require('winston');

winston.add(winston.transports.File, {
    filename: `${__dirname***REMOVED***/logs/user_selected.log`,
    level: 'info',
    timestamp: true,
    handleExceptions: true
***REMOVED***);

// Only log it in log file
winston.remove(winston.transports.Console);


var logUserSelection = function *() {
***REMOVED*** - user_id=>environment (keeps it reasonably anonymous)
    var headers = this.req.headers;

***REMOVED*** User selected CUI (by clicking)
    var query   = this.request.body.query || "";

***REMOVED*** String used to create autocompletion suggestion list
    var user_typed = this.request.body.user_typed || "";

***REMOVED*** Pref. term of the clicked suggestion
{'fraction_non_alphanumeric': 0.17035611164581327, 'fraction_numerical': 0.0, 'mean_word_length': 4.5, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '5402570', 'n_tokens_mistral': 658, 'n_tokens_neox': 643, 'n_words': 172}