<commit_before>/**
 * Created by <NAME> on 2014/7/14.
 */
var activity_templete = require('../../config/activity_templete');
var redis_activity_wrapper = require('../nosql/redis_activity_wrapper');

var activity_wrapper = function() {
    //  init once
    if(1)
    {
        this.init(activity_templete);
    }
};

activity_wrapper.prototype.init = function(activity_template){
    redis_activity_wrapper.add_activity('template','0.0.0',activity_template);
};

activity_wrapper.prototype.get = function(channel,version,cb){
    redis_activity_wrapper.get_activity(channel,version,function(reply){
        if(reply){
            cb(JSON.parse(reply));
        }else{
            redis_activity_wrapper.get_activity('template','0.0.0',function(reply){<commit_msg>get the default version 's template if not found matched,make sure the version' default template exits<commit_after>/**
 * Created by <NAME> on 2014/7/14.
 */
var activity_templete = require('../../config/activity_templete');
var redis_activity_wrapper = require('../nosql/redis_activity_wrapper');

var activity_wrapper = function() {
    //  init once
    if(1)
    {
        this.init(activity_templete);
    }
};

activity_wrapper.prototype.init = function(activity_template){
    redis_activity_wrapper.add_activity('template','1.2.4',activity_template);
};

activity_wrapper.prototype.get = function(channel,version,cb){
    redis_activity_wrapper.get_activity(channel,version,function(reply){
        if(reply){
            cb(JSON.parse(reply));
        }else{
            redis_activity_wrapper.get_activity('template',version,function(reply){
{'fraction_non_alphanumeric': 0.13808049535603714, 'fraction_numerical': 0.015479876160990712, 'mean_word_length': 4.146496815286624, 'pattern_counts': {'":': 0, '<': 5, '<?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': '5704285', 'n_tokens_mistral': 493, 'n_tokens_neox': 481, 'n_words': 72}