<commit_before>angular.module('app').controller 'ServiceCtrl', ($scope,$http,$stateParams,toastr,services) !->
  $scope.service = $stateParams.service
  $scope.name=$scope.service
  $scope.maxNGrams=3
  $scope.detph=1
  $scope.query='''
    PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
    PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
    SELECT ?id ?label ?ngram {
      VALUES ?ngram {
        <VALUES>
      }
      BIND(?ngram AS ?label)
      ?id rdfs:label|skos:prefLabel ?label .
    }
  '''
  $scope.delete = !->
    response <-! $http.delete(services+$scope.service).then(_,$scope.handleError)
    toastr.success("Successfully removed service #{$scope.service} (#{$scope.name})")
  $scope.submit = !->
    map = {}
    for kv in $scope.positiveLASFilters.split(/, ?/)
      [k,v] = kv.split(':')
      map.[][k].push(v)
    positiveLASFilters = map
    map = {}
    for kv in $scope.negativeLASFilters.split(/, ?/)
      [k,v] = kv.split(':')
      map.[][k].push(v)
    negativeLASFilters = map
    map = {}
    for kv in $scope.strongNegativeLASFilters.split(/, ?/)
      [k,v] = kv.split(':')
      map.[][k].push(v)
    strongNegativeLASFilters = map
    response <-! $http.put(services+$scope.service,{
      $scope.name
      $scope.endpointURL
      $scope.lasLocale
      $scope.queryUsingOriginalForm
      $scope.queryUsingBaseform
      queryUsingInflections: if (typeof $scope.queryUsingInflections == 'string') then $scope.queryUsingInflections.split(/, ?/) else $scope.queryUsingInflections
      $scope.queryModifyingEveryPart
      $scope.queryModifyingOnlyLastPart
      positiveLASFilters
      negativeLASFilters
      strongNegativeLASFilters
      $scope.guess
      $scope.query
      depth:parseInt($scope.depth)
      maxNGrams:parseInt($scope.maxNGrams)
    }).then(_,$scope.handleError)
    toastr.success("Successfully saved service #{$scope.service} (#{$scope.name})")
  $scope.loading = true
  response <-! $http.get(services+$scope.service).then(_,(response) !-> if response.status!=404 then $scope.handleError(response) else $scope.loading=false)
  $scope.loading=false
  $scope.negativeLASFilters = ''
  $scope.strongNegativeLASFilters = ''
  $scope.positiveLASFilters = ''
  for item,value of response.data
    if (item=='negativeLASFilters')
      if (value)
        for k,va of value
          for v in va
            $scope.negativeLASFilters += k+':'+v+', '
        $scope.negativeLASFilters = $scope.negativeLASFilters.substring(0,$scope.negativeLASFilters.length-2)
    else if (item=='strongNegativeLASFilters')
      if (value)
        for k,va of value
          for v in va
            $scope.strongNegativeLASFilters += k+':'+v+', '
        $scope.strngNegativeLASFilters = $scope.strongNegativeLASFilters.substring(0,$scope.strongNegativeLASFilters.length-2)
    else if (item=='positiveLASFilters')
      if (value)
        for k,va of value
          for v in va
            $scope.positiveLASFilters += k+':'+v+', '
        $scope.positiveLASFilters = $scope.positiveLASFilters.substring(0,$scope.positiveLASFilters.length-2)
    else $scope[item]=value<commit_msg>fix variable name typo<commit_after>angular.module('app').controller 'ServiceCtrl', ($scope,$http,$stateParams,toastr,services) !->
  $scope.service = $stateParams.service
  $scope.name=$scope.service
  $scope.maxNGrams=3
  $scope.detph=1
  $scope.query='''
    PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
    PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
    SELECT ?id ?label ?ngram {
      VALUES ?ngram {
        <VALUES>
      }
      BIND(?ngram AS ?label)
      ?id rdfs:label|skos:prefLabel ?label .
    }
  '''
  $scope.delete = !->
    response <-! $http.delete(services+$scope.service).then(_,$scope.handleError)
    toastr.success("Successfully removed service #{$scope.service} (#{$scope.name})")
  $scope.submit = !->
    map = {}
    for kv in $scope.positiveLASFilters.split(/, ?/)
      [k,v] = kv.split(':')
      map.[][k].push(v)
    positiveLASFilters = map
    map = {}
    for kv in $scope.negativeLASFilters.split(/, ?/)
      [k,v] = kv.split(':')
      map.[][k].push(v)
    negativeLASFilters = map
    map = {}
    for kv in $scope.strongNegativeLASFilters.split(/, ?/)
      [k,v] = kv.split(':')
      map.[][k].push(v)
    strongNegativeLASFilters = map
    response <-! $http.put(services+$scope.service,{
      $scope.name
      $scope.endpointURL
      $scope.lasLocale
      $scope.queryUsingOriginalForm
      $scope.queryUsingBaseform
      queryUsingInflections: if (typeof $scope.queryUsingInflections == 'string') then $scope.queryUsingInflections.split(/, ?/) else $scope.queryUsingInflections
      $scope.queryModifyingEveryPart
      $scope.queryModifyingOnlyLastPart
      positiveLASFilters
      negativeLASFilters
      strongNegativeLASFilters
      $scope.guess
      $scope.query
      depth:parseInt($scope.depth)
      maxNGrams:parseInt($scope.maxNGrams)
    }).then(_,$scope.handleError)
    toastr.success("Successfully saved service #{$scope.service} (#{$scope.name})")
  $scope.loading = true
  response <-! $http.get(services+$scope.service).then(_,(response) !-> if response.status!=404 then $scope.handleError(response) else $scope.loading=false)
  $scope.loading=false
  $scope.negativeLASFilters = ''
  $scope.strongNegativeLASFilters = ''
  $scope.positiveLASFilters = ''
  for item,value of response.data
    if (item=='negativeLASFilters')
      if (value)
        for k,va of value
          for v in va
            $scope.negativeLASFilters += k+':'+v+', '
        $scope.negativeLASFilters = $scope.negativeLASFilters.substring(0,$scope.negativeLASFilters.length-2)
    else if (item=='strongNegativeLASFilters')
      if (value)
        for k,va of value
          for v in va
            $scope.strongNegativeLASFilters += k+':'+v+', '
        $scope.strongNegativeLASFilters = $scope.strongNegativeLASFilters.substring(0,$scope.strongNegativeLASFilters.length-2)
    else if (item=='positiveLASFilters')
      if (value)
        for k,va of value
          for v in va
            $scope.positiveLASFilters += k+':'+v+', '
        $scope.positiveLASFilters = $scope.positiveLASFilters.substring(0,$scope.positiveLASFilters.length-2)
    else $scope[item]=value
{'fraction_non_alphanumeric': 0.15213239974538512, 'fraction_numerical': 0.007956715467854869, 'mean_word_length': 3.212466487935657, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 4, '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': '488359', 'n_tokens_mistral': 2130, 'n_tokens_neox': 2047, 'n_words': 338}