<commit_before>import {Injectable} from "@angular/core";
import {Http} from '@angular/http';
import "rxjs/add/operator/map";
import "rxjs/add/operator/share";
import {Observable} from "rxjs";
import {AppConfigService} from "../../shared/services/config/app-config.service";
import {HashTag} from "../../shared/models/hashtag";

@Injectable()
export class HashTagService {

  constructor(private http: Http, private  configService: AppConfigService) {
  }

  public getData(parentTag : string): Observable<HashTag[]> {

    let uri = this.configService.getApp<string>("apiEndpoint") + `hashtag/children/${parentTag}`;

    return this.http.get(uri)
      .map(hashtags => this.getHashtags(hashtags))
      .share();
  }

  private getHashtags(hashtags: any): HashTag[] {
    let tags = <HashTag[]>hashtags.json();
    return tags.filter(x => x.isEnabled);
  }
}
<commit_msg>Fixes  #18 - Change VK to support service tokens and auth<commit_after>import {Injectable} from "@angular/core";
import {Http} from '@angular/http';
import "rxjs/add/operator/map";
import "rxjs/add/operator/share";
import {Observable} from "rxjs";
import {AppConfigService} from "../../shared/services/config/app-config.service";
import {HashTag} from "../../shared/models/hashtag";
import {$} from "protractor";

@Injectable()
export class HashTagService {

  constructor(private http: Http, private  configService: AppConfigService) {
  }

  public getData(parentTag : string): Observable<HashTag[]> {

    let uri = this.configService.getApp<string>("apiEndpoint") + `hashtag/children/${parentTag}`;

    return this.http.get(uri)
      .map(hashtags => this.getHashtags(hashtags))
      .share();
  }

  private getHashtags(hashtags: any): HashTag[] {
    console.log(hashtags);

    let tags = <HashTag[]>hashtags.json();
     for(let i = 0; i< tags.length; i++){
       tags[i].hashTag = `${tags[i].hashTag}`;
     }
    return tags.filter(x => x.isEnabled);
  }
}

{'fraction_non_alphanumeric': 0.16563786008230452, 'fraction_numerical': 0.0015432098765432098, 'mean_word_length': 4.2710027100271, 'pattern_counts': {'":': 0, '<': 10, '<?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': '1883764', 'n_tokens_mistral': 642, 'n_tokens_neox': 643, 'n_words': 135}