<commit_before>translate = require 't7e'
Classification = zooniverse.models.Classification
SubjectQueue = zooniverse.SubjectQueue

module.exports = App.ClassifyController = Ember.ObjectController.extend
  needs: ['application']
  applicationBinding: 'controllers.application'
  classification: null
  recentPairs: []
  switching: false
  
  project: (->
    @get('application.model')
  ).property('')
  
  explanationDialog: ->
    html = """
      <button type="button" name="close-dialog">&times;</button>
      <div class="explanation">
        #{ translate 'p', 'explanation.part1' }
        #{ translate 'p', 'explanation.part2' }
        #{ translate 'p', 'explanation.part3' }
      </div>
    """
    dialog = new zooniverse.controllers.Dialog content: $(html)
  
  actions:
    explain: ->
      zooniverse.GoogleAnalytics.event category: 'navigation', action: 'click', label: 'classify', 'help'
      @explanation or= @explanationDialog()
      @explanation.show()
    
    invert: ->
      @set 'invertedToggled', true
      @get('model').toggleInverted()
    
    choose: (subject) ->
      return if @get('switching')
      @set 'switching', true
      
      @get('classification').annotate selected_id: subject.id
      @get('classification').annotate inverted: @getWithDefault('invertedToggled', false)
      @get('classification').send()
      
      user = zooniverse.models.User.current
      user.project.classification_count += 1 if user
      zooniverse.classificationCount += 1
      
      SubjectQueue.next().then (pair) =>
        @set 'model', pair
        @set 'switching', false
        if pair
          @set 'classification', new Classification subjects: @get('model').subjects
        else
          # TO-DO: error reporting
          @transitionTo 'index'
<commit_msg>Tweak label<commit_after>translate = require 't7e'
Classification = zooniverse.models.Classification
SubjectQueue = zooniverse.SubjectQueue

module.exports = App.ClassifyController = Ember.ObjectController.extend
  needs: ['application']
  applicationBinding: 'controllers.application'
  classification: null
  recentPairs: []
  switching: false
  
  project: (->
    @get('application.model')
  ).property('')
  
  explanationDialog: ->
    html = """
      <button type="button" name="close-dialog">&times;</button>
      <div class="explanation">
        #{ translate 'p', 'explanation.part1' }
        #{ translate 'p', 'explanation.part2' }
        #{ translate 'p', 'explanation.part3' }
      </div>
    """
    dialog = new zooniverse.controllers.Dialog content: $(html)
  
  actions:
    explain: ->
      zooniverse.GoogleAnalytics.event category: 'navigation', action: 'click', label: 'classify.help', 'true'
      @explanation or= @explanationDialog()
      @explanation.show()
    
    invert: ->
      @set 'invertedToggled', true
      @get('model').toggleInverted()
    
    choose: (subject) ->
      return if @get('switching')
      @set 'switching', true
      
      @get('classification').annotate selected_id: subject.id
      @get('classification').annotate inverted: @getWithDefault('invertedToggled', false)
      @get('classification').send()
      
      user = zooniverse.models.User.current
      user.project.classification_count += 1 if user
      zooniverse.classificationCount += 1
      
      SubjectQueue.next().then (pair) =>
        @set 'model', pair
        @set 'switching', false
        if pair
          @set 'classification', new Classification subjects: @get('model').subjects
        else
          # TO-DO: error reporting
          @transitionTo 'index'

{'fraction_non_alphanumeric': 0.13564493758668517, 'fraction_numerical': 0.00332871012482663, 'mean_word_length': 2.9845303867403317, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 23, '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': '4488562', 'n_tokens_mistral': 1059, 'n_tokens_neox': 1036, 'n_words': 219}