<commit_before>import {Component, OnDestroy, OnInit} from '@angular/core';

import {Subscription} from 'rxjs';

import {HsEventBusService} from '../core/event-bus.service';
import {HsSearchService} from './search.service';
import {HsShareUrlService} from './../permalink/share-url.service';
@Component({
  selector: 'hs-search',
  templateUrl: './partials/search.html',
})
export class HsSearchComponent implements OnInit, OnDestroy {
  replace = false;
  clearVisible = false;
  searchInputVisible: boolean;
  query = '';
  searchResultsReceivedSubscription: Subscription;
  constructor(
    public HsSearchService: HsSearchService,
    public HsEventBusService: HsEventBusService,
    public HsShareUrlService: HsShareUrlService
  ) {
    this.searchResultsReceivedSubscription =
      this.HsEventBusService.searchResultsReceived.subscribe(() => {
        this.clearVisible = true;
      });
  }
  ngOnDestroy(): void {
    this.searchResultsReceivedSubscription.unsubscribe();
  }

  ngOnInit(): void {
    if (this.HsShareUrlService.getParamValue('search')) {
      this.query = this.HsShareUrlService.getParamValue('search');
      this.queryChanged();
    }
    window.innerWidth < 767
      ? (this.searchInputVisible = false)
      : (this.searchInputVisible = true);
  }
  /**
   * Handler of search input, request search service and display results div
   */
  queryChanged(): void {
    this.HsSearchService.request(this.query);
  }
  //not being used anywhere

  // /**
  //  * Set property highlighted of result to state
  //  * @param {object} result Record to highlight
  //  * @param {string} state To highlight or not to highlight
  //  */
  // highlightResult(result: any, state: any): void {
  //   if (result.feature !== undefined) {
  //     setHighlighted(result.feature, state);
  //   }
  // }

  /**
   * Remove previous search and search results
   *
   */
  clear(): void {
    this.query = '';
    this.clearVisible = false;
    this.HsSearchService.cleanResults();
  }
}<commit_msg>refactor: Remove dead search code<commit_after>import {Component, OnDestroy, OnInit} from '@angular/core';
import {Subscription} from 'rxjs';

import {HsEventBusService} from '../core/event-bus.service';
import {HsSearchService} from './search.service';
import {HsShareUrlService} from './../permalink/share-url.service';
@Component({
  selector: 'hs-search',
  templateUrl: './partials/search.html',
})
export class HsSearchComponent implements OnInit, OnDestroy {
  replace = false;
  clearVisible = false;
  searchInputVisible: boolean;
  searchResultsReceivedSubscription: Subscription;
  constructor(
    public HsSearchService: HsSearchService,
    public HsEventBusService: HsEventBusService,
    public HsShareUrlService: HsShareUrlService
  ) {
    this.searchResultsReceivedSubscription =
      this.HsEventBusService.searchResultsReceived.subscribe(() => {
        this.clearVisible = true;
      });
  }
  ngOnDestroy(): void {
    this.searchResultsReceivedSubscription.unsubscribe();
  }

  ngOnInit(): void {
    window.innerWidth < 767
      ? (this.searchInputVisible = false)
      : (this.searchInputVisible = true);
  }
}
{'fraction_non_alphanumeric': 0.12432603869330797, 'fraction_numerical': 0.0019029495718363464, 'mean_word_length': 3.742857142857143, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '12838', 'n_tokens_mistral': 932, 'n_tokens_neox': 916, 'n_words': 204}