<commit_before>class window.AddEvidenceFormView extends Backbone.Marionette.Layout
  className: 'add-evidence-form'
  template: 'evidence/add_evidence'

  regions:
    inputRegion:
      selector: '.input-region'
      regionType: Factlink.DetachableViewsRegion

  initialize: ->
    @_recent_collection = new RecentlyViewedFacts
    @_recent_collection.fetch()

    @inputRegion.defineViews
      search_view: => @searchView()
      add_comment_view: => @addCommentView()

  onRender: ->
    @switchToCommentView()

  _filtered_facts: ->
    fact_relations_masquerading_as_facts = @_collectionUtils().map new Backbone.Collection,
      @collection, (model) -> new Fact model.get('from_fact')

    @_collectionUtils().union new Backbone.Collection, fact_relations_masquerading_as_facts,
      new Backbone.Collection [@collection.fact.clone()]

  _collectionUtils: ->
    @_____collectionUtils ?= new CollectionUtils this

  searchView: ->
    searchView = new AutoCompleteFactRelationsView
      collection: @_filtered_facts()
      fact_id: @collection.fact.id
      type: @collection.believesType()
      recent_collection: @_recent_collection
    @listenTo searchView, 'createFactRelation', (fact_relation, onFinish) ->
      @createFactRelation(fact_relation, onFinish)
    @listenTo searchView, 'switch_to_comment_view', @switchToCommentView
    searchView

  addCommentView: ->
    addCommentView = new AddCommentView
      addToCollection: @collection
      type: @options.type
      ndp: @options.ndp
    @listenTo addCommentView, 'switch_to_fact_relation_view', @switchToFactRelationView

    addCommentView
<commit_msg>Removed unused option<commit_after>class window.AddEvidenceFormView extends Backbone.Marionette.Layout
  className: 'add-evidence-form'
  template: 'evidence/add_evidence'

  regions:
    inputRegion:
      selector: '.input-region'
      regionType: Factlink.DetachableViewsRegion

  initialize: ->
    @_recent_collection = new RecentlyViewedFacts
    @_recent_collection.fetch()

    @inputRegion.defineViews
      search_view: => @searchView()
      add_comment_view: => @addCommentView()

  onRender: ->
    @switchToCommentView()

  _filtered_facts: ->
    fact_relations_masquerading_as_facts = @_collectionUtils().map new Backbone.Collection,
      @collection, (model) -> new Fact model.get('from_fact')

    @_collectionUtils().union new Backbone.Collection, fact_relations_masquerading_as_facts,
      new Backbone.Collection [@collection.fact.clone()]

  _collectionUtils: ->
    @_____collectionUtils ?= new CollectionUtils this

  searchView: ->
    searchView = new AutoCompleteFactRelationsView
      collection: @_filtered_facts()
      fact_id: @collection.fact.id
      type: @collection.believesType()
      recent_collection: @_recent_collection
    @listenTo searchView, 'createFactRelation', (fact_relation, onFinish) ->
      @createFactRelation(fact_relation, onFinish)
    @listenTo searchView, 'switch_to_comment_view', @switchToCommentView
    searchView

  addCommentView: ->
    addCommentView = new AddCommentView
      addToCollection: @collection
      type: @options.type
    @listenTo addCommentView, 'switch_to_fact_relation_view', @switchToFactRelationView

    addCommentView

{'fraction_non_alphanumeric': 0.09278668310727498, 'fraction_numerical': 0.0, 'mean_word_length': 4.354785478547854, 'pattern_counts': {'":': 0, '<': 3, '<?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': '1563367', 'n_tokens_mistral': 992, 'n_tokens_neox': 929, 'n_words': 174}