<commit_before>import { Component, OnInit } from '@angular/core';
import { ActivatedRoute } from '@angular/router';
import { BehaviorSubject, Observable } from 'rxjs';
import { switchMap } from 'rxjs/operators';
import { Deployment } from 'src/app/deployment/deployment';
import { DeploymentService } from 'src/app/deployment/deployment.service';
import { DeploymentsStoreService } from '../deployments-store.service';
import { DeploymentLog } from './deployment-log';
import { DeploymentLogStoreService } from './deployment-log-store.service';

declare var CodeMirror: any;
@Component({
  selector: 'app-logs',
  templateUrl: './logs.component.html',
  styleUrls: ['./logs.component.scss'],
})
export class LogsComponent implements OnInit {
  deployment$: Observable<Deployment>;
  deploymentLogs$: Observable<DeploymentLog[]>;

  currentFilename = new BehaviorSubject<string>('');

  readonly deploymentLog$ = this.currentFilename.pipe(
    switchMap(this.deploymentLogStore.withName$)
  );

  constructor(
    private deploymentService: DeploymentService,
    private deploymentStore: DeploymentsStoreService,
    public deploymentLogStore: DeploymentLogStoreService,
    private route: ActivatedRoute
  ) {}

  ngOnInit(): void {
    CodeMirror.defineSimpleMode('simplemode', {
      start: [{ regex: /(error|failure|failed)\b/i, token: 'error' }],
    });

    this.route.paramMap.subscribe((params) => {
      const deploymentId: number = +params.get('deploymentId');

      this.deployment$ = this.deploymentStore.withid$(deploymentId);
      this.deploymentLogStore.fetch(deploymentId);
      this.deploymentLogStore.filenames$.subscribe((filenames) =>
        this.currentFilename.next(filenames[0])
      );

      this.deployment$.subscribe((deployment) => {
        if (deployment === undefined) {
          this.deploymentService.get(deploymentId).subscribe((d) => {
            this.deploymentStore.deployments = [d];
          });
        }
      });
    });
  }

  selectFile(filename: string) {
    this.currentFilename.next(filename);
  }
}
<commit_msg>add fatal to list of highlighted words<commit_after>import { Component, OnInit } from '@angular/core';
import { ActivatedRoute } from '@angular/router';
import { BehaviorSubject, Observable } from 'rxjs';
import { switchMap } from 'rxjs/operators';
import { Deployment } from 'src/app/deployment/deployment';
import { DeploymentService } from 'src/app/deployment/deployment.service';
import { DeploymentsStoreService } from '../deployments-store.service';
import { DeploymentLog } from './deployment-log';
import { DeploymentLogStoreService } from './deployment-log-store.service';

declare var CodeMirror: any;
@Component({
  selector: 'app-logs',
  templateUrl: './logs.component.html',
  styleUrls: ['./logs.component.scss'],
})
export class LogsComponent implements OnInit {
  deployment$: Observable<Deployment>;
  deploymentLogs$: Observable<DeploymentLog[]>;

  currentFilename = new BehaviorSubject<string>('');

  readonly deploymentLog$ = this.currentFilename.pipe(
    switchMap(this.deploymentLogStore.withName$)
  );

  constructor(
    private deploymentService: DeploymentService,
    private deploymentStore: DeploymentsStoreService,
    public deploymentLogStore: DeploymentLogStoreService,
    private route: ActivatedRoute
  ) {}

  ngOnInit(): void {
    CodeMirror.defineSimpleMode('simplemode', {
      start: [{ regex: /(error|failure|failed|fatal)\b/i, token: 'error' }],
    });

    this.route.paramMap.subscribe((params) => {
      const deploymentId: number = +params.get('deploymentId');

      this.deployment$ = this.deploymentStore.withid$(deploymentId);
      this.deploymentLogStore.fetch(deploymentId);
      this.deploymentLogStore.filenames$.subscribe((filenames) =>
        this.currentFilename.next(filenames[0])
      );

      this.deployment$.subscribe((deployment) => {
        if (deployment === undefined) {
          this.deploymentService.get(deploymentId).subscribe((d) => {
            this.deploymentStore.deployments = [d];
          });
        }
      });
    });
  }

  selectFile(filename: string) {
    this.currentFilename.next(filename);
  }
}

{'fraction_non_alphanumeric': 0.13587347232207045, 'fraction_numerical': 0.0004792715073088905, 'mean_word_length': 4.159456118665019, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 17, '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': '3519038', 'n_tokens_mistral': 1214, 'n_tokens_neox': 1188, 'n_words': 218}