<commit_before>import cobalt from './cobalt.js';

class CobaltAnnotation {
    constructor(range, tag) {
        if (typeof range == 'CobaltAnnotation') {
            return range;
        }
        if (typeof tag == 'undefined') {
            tag = range.substr(range.indexOf(':')+1);
            range = range.substr(0, range.indexOf(':'));
        }
        this.range = cobalt.range(range);
        this.tag   = tag.trim();
        var elements = this.tag.split(/\s/,1);<commit_msg>fixed type checking of the range parameter in the constructor<commit_after>import cobalt from './cobalt.js';

class CobaltAnnotation {
    constructor(range, tag) {
        if (range.constructor && range.constructor.name == 'CobaltAnnotation') {
            return range;
        }
        if (typeof tag == 'undefined') {
            tag = range.substr(range.indexOf(':')+1);
            range = range.substr(0, range.indexOf(':'));
        }
        this.range = cobalt.range(range);
        this.tag   = tag.trim();
        var elements = this.tag.split(/\s/,1);
{'fraction_non_alphanumeric': 0.15128449096098953, 'fraction_numerical': 0.005708848715509039, 'mean_word_length': 2.207317073170732, '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': '738527', 'n_tokens_mistral': 311, 'n_tokens_neox': 300, 'n_words': 68}