<commit_before>import { Component, OnInit } from '@angular/core';
import { FactionService } from '../../../data/services/faction.service';
import { Faction } from '../../../data/models/faction';
import { ActivatedRoute } from '@angular/router';
import { FACTION_ROUTE } from '../../app.routes.model';
import { LinkLocation } from '../../directive/insertLinks/insertLinks.directive';

export const FACTION_PARAM = 'group';
export const ALL_GROUPS = 'Alle';

@Component({
  selector: 'lc-factions',
  templateUrl: 'factions.page.html',
  styleUrls: [ 'factions.page.scss' ]
})
export class FactionsPage implements OnInit {

  // A list of all groups, including an ALL option
  public selectableGroups: string[];
  // Contains all factions - just a flattened version of "groups"
  public allFactions: Faction[];
  // The current selected group
  public group: Faction[];
  public showSelect: boolean;
  private groups: { [ group: string ]: Faction[] };
  private factionSorter: (a: Faction, b: Faction) => number = (a, b) => a.name.localeCompare(b.name);

  constructor(private factionService: FactionService, private activatedRoute: ActivatedRoute) {
    this.activeGroup = ALL_GROUPS;
    factionService.getFactions().subscribe((factions) => {
      this.groups = factions;
      this.allFactions = Object.keys(this.groups)
        .map((key) => this.groups[ key ])
        .reduce((previousValue, currentValue) => previousValue.concat(currentValue), [])
        .sort(this.factionSorter);
      this.selectableGroups = [ ALL_GROUPS, ... Object.keys(factions) ];
      this.updateFactions();
    });

  }

  private _activeGroup: string;

  public get activeGroup(): string {
    return this._activeGroup;
  }<commit_msg>tslint<commit_after>import { Component, OnInit } from '@angular/core';
import { FactionService } from '../../../data/services/faction.service';
import { Faction } from '../../../data/models/faction';
import { ActivatedRoute } from '@angular/router';
import { FACTION_ROUTE } from '../../app.routes.model';
import { LinkLocation } from '../../directive/insertLinks/insertLinks.directive';

export const FACTION_PARAM = 'group';
export const ALL_GROUPS = 'Alle';

@Component({
  selector: 'lc-factions',
  templateUrl: 'factions.page.html',
  styleUrls: [ 'factions.page.scss' ]
})
export class FactionsPage implements OnInit {

  // A list of all groups, including an ALL option
  public selectableGroups: string[];
  // Contains all factions - just a flattened version of "groups"
  public allFactions: Faction[];
  // The current selected group
  public group: Faction[];
  public showSelect: boolean;
  private groups: { [ group: string ]: Faction[] };
  private _activeGroup: string;
  private factionSorter: (a: Faction, b: Faction) => number = (a, b) => a.name.localeCompare(b.name);

  constructor(private factionService: FactionService, private activatedRoute: ActivatedRoute) {
    this.activeGroup = ALL_GROUPS;
    factionService.getFactions().subscribe((factions) => {
      this.groups = factions;
      this.allFactions = Object.keys(this.groups)
        .map((key) => this.groups[ key ])
        .reduce((previousValue, currentValue) => previousValue.concat(currentValue), [])
        .sort(this.factionSorter);
      this.selectableGroups = [ ALL_GROUPS, ... Object.keys(factions) ];
      this.updateFactions();
    });

  }


  public get activeGroup(): string {
    return this._activeGroup;
  }
{'fraction_non_alphanumeric': 0.14564520827264782, 'fraction_numerical': 0.0, 'mean_word_length': 3.8298171589310828, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 13, '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': '7544145', 'n_tokens_mistral': 1026, 'n_tokens_neox': 1026, 'n_words': 254}