<commit_before>import {Component} from "@angular/core";
import {Router} from "@angular/router";

@Component({
  selector: 'jp-landing',
  templateUrl: 'landing.component.html'
})

export class LandingComponent {
  constructor(private router: Router) {
  }

  openDocument(_id: string) {
    if (_id) {
      _id = _id.split(" ").join("-").substr(0, 64);
      let link = ['edit', _id];
      this.router.navigate(link);
    }
  }

}<commit_msg>Fix #50 force document names to lowercase<commit_after>import {Component} from "@angular/core";
import {Router} from "@angular/router";

@Component({
  selector: 'jp-landing',
  templateUrl: 'landing.component.html'
})

export class LandingComponent {
  constructor(private router: Router) {
  }

  openDocument(_id: string) {
    if (_id) {
      // [$&+,:;=?@#|'<>.-^*()%!]" -> regexp special chars
      // remove all special chars of URIs and regexp
      /*
        Test:
        var s = "A[B$C&D+E,F:G;H=I?J@K#L|M'N<O>P.Q-R^S*U(V)W%X!Y]Z\"A";
        var pattern = /[\:/\?\#\[\]\@\!\$\&\'\(\)\*\+\,\;\=\"\|\<\>\-\^\%\.]/g
        s.replace(pattern, s) == "ABCDEFGHIJKLMNOPQRSUVWXYZA"
      */

      let pattern = /[\:/\?\#\[\]\@\!\$\&\'\(\)\*\+\,\;\=\"\|\<\>\-\^\%\.]/g
      _id = _id.replace(pattern, "");
      _id = _id.split(" ").join("-").substr(0, 64).toLowerCase();
      let link = ['edit', _id];
      this.router.navigate(link);
    }
  }

}
{'fraction_non_alphanumeric': 0.25089094796863864, 'fraction_numerical': 0.005702066999287242, 'mean_word_length': 2.704485488126649, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 8, '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': '2647085', 'n_tokens_mistral': 556, 'n_tokens_neox': 531, 'n_words': 96}