<commit_before>module TypeDoc.Factories
{
    export class BasePath
    {
        basePath:string;


        add(fileName:string) {
            var dirname = BasePath.normalize(Path.dirname(fileName));
            if (this.basePath) {
                var basePath = this.basePath;
                var len = basePath.length;

                while (basePath != dirname.substr(0, len)) {
                    if (len <= dirname.length) {
                        return;
                    }

                    var parentPath = BasePath.normalize(Path.resolve(Path.join(basePath, '..')));
                    if (basePath == parentPath) break;
                    basePath = parentPath;
                    len = basePath.length;
                }

                this.basePath = basePath;
            } else {
                this.basePath = dirname;
            }
        }


        trim(fileName:string) {
            if (fileName.substr(0, this.basePath.length) == this.basePath) {
                return fileName.substr(this.basePath.length + 1);
            } else {
                return fileName;<commit_msg>BasePath does not truncate paths<commit_after>module TypeDoc.Factories
{
    export class BasePath
    {
        basePath:string;


        add(fileName:string) {
            var dirname = BasePath.normalize(Path.dirname(fileName));
            if (this.basePath) {
                var basePath = this.basePath;
                var len = basePath.length;

                while (basePath != dirname.substr(0, len)) {
                    if (len >= dirname.length) {
                        return;
                    }

                    var parentPath = BasePath.normalize(Path.resolve(Path.join(basePath, '..')));
                    if (basePath == parentPath) break;
                    basePath = parentPath;
                    len = basePath.length;
                }

                this.basePath = basePath;
            } else {
                this.basePath = dirname;
            }
        }


        trim(fileName:string) {
            if (fileName.substr(0, this.basePath.length) == this.basePath) {
                return fileName.substr(this.basePath.length + 1);
            } else {
                return fileName;
{'fraction_non_alphanumeric': 0.0975609756097561, 'fraction_numerical': 0.0026607538802660754, 'mean_word_length': 1.2627883650952858, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, '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': '344641', 'n_tokens_mistral': 603, 'n_tokens_neox': 567, 'n_words': 109}