<commit_before>module ItemsHelper
  def getButtonForFilter(filter)
    @OPEN_CALAIS_URI = 'http://www.opencalais.org/Entities#'
    @WIKI_META_URI = 'http://www.wikimeta.org/Entities#'
    @INSEE_GEO_URI = 'http://rdf.insee.fr/geo/'
    @RSS_URI = 'http://purl.org/rss/1.0/'
    @SVM_PLUGIN_URI = 'http://zone-project.org/model/plugins/Categorization_SVM#result'
    @TWITTER_MENTIONED_PLUGIN_URI = 'http://zone-project.org/model/plugins/twitter#mentioned'
    @TWITTER_HASHTAG_PLUGIN_URI = 'http://zone-project.org/model/plugins/twitter#hashtag'

    @LABEL = "label"
    @LABEL_INFO = "label label-info"
    @LABEL_SUCCESS = "label label-success"
    @LABEL_WARNING = "label label-warning"
    @LABEL_IMPORTANT = "label label-important"

    if(filter.value == "null")
      filter.value = "/null"
    end
    itemURI = items_path(:old => @filters,:new => filter)
    if(filter.prop.starts_with? @OPEN_CALAIS_URI)
      itemClassFilter=getClassLabel(filter.prop[@OPEN_CALAIS_URI.length,filter.prop.length])
      #res= link_to filter.prop[@OPEN_CALAIS_URI.length,filter.prop.length], itemURI, :class =>  itemClassFilter
      res= link_to filter.value, itemURI, :class =>  itemClassFilter
    elsif(filter.prop.starts_with? @WIKI_META_URI)
      itemClassFilter=getClassLabel(filter.prop[@WIKI_META_URI.length,filter.prop.length])
      #res=link_to filter.prop[@WIKI_META_URI.length,filter.prop.length], itemURI, :class => itemClassFilter
      if(filter.value.rindex('/') == nil)
        res=link_to filter.value, itemURI, :class => itemClassFilter

      else
        res=link_to filter.value[filter.value.rindex('/')+1, filter.value.length], itemURI, :class => itemClassFilter
      end
    elsif(filter.prop.starts_with? @INSEE_GEO_URI)
      itemClassFilter=getClassLabel(filter.prop[@INSEE_GEO_URI.length,filter.prop.length])
      #res=link_to filter.prop[@INSEE_GEO_URI.length,filter.prop.length], itemURI, :class => itemClassFilter
      res=link_to filter.value[filter.value.rindex('/')+1, filter.value.length], itemURI, :class => itemClassFilter
    elsif(filter.prop.start_with? @RSS_URI+"source")
      itemClassFilter=getClassLabel(filter.prop[@RSS_URI.length,filter.prop.length])
      #res=link_to filter.prop[@RSS_URI.length,filter.prop.length], itemURI, :class => itemClassFilter
      res=link_to filter.value, itemURI, :class => itemClassFilter
    elsif(filter.prop.start_with? @SVM_PLUGIN_URI)
      #res=link_to "category", itemURI, :class => @LABEL_INFO
      res=link_to filter.value, itemURI, :class => @LABEL_INFO
    elsif(filter.prop.start_with? @TWITTER_HASHTAG_PLUGIN_URI)
      res=link_to "#"+filter.value, itemURI, :class => "btn-auth  btn-twitter"
    elsif(filter.prop.start_with? @TWITTER_MENTIONED_PLUGIN_URI)
      res=link_to "@"+filter.value, itemURI, :class => "btn-auth btn-twitter"
    end
  end

  def removeFilterFromList(list, filter)
    puts list.class<commit_msg>Added the first draft of tooltip for the tag<commit_after>module ItemsHelper
  def getButtonForFilter(filter)
    @OPEN_CALAIS_URI = 'http://www.opencalais.org/Entities#'
    @WIKI_META_URI = 'http://www.wikimeta.org/Entities#'
    @INSEE_GEO_URI = 'http://rdf.insee.fr/geo/'
    @RSS_URI = 'http://purl.org/rss/1.0/'
    @SVM_PLUGIN_URI = 'http://zone-project.org/model/plugins/Categorization_SVM#result'
    @TWITTER_MENTIONED_PLUGIN_URI = 'http://zone-project.org/model/plugins/twitter#mentioned'
    @TWITTER_HASHTAG_PLUGIN_URI = 'http://zone-project.org/model/plugins/twitter#hashtag'

    @LABEL = "label"
    @LABEL_INFO = "label label-info"
    @LABEL_SUCCESS = "label label-success"
    @LABEL_WARNING = "label label-warning"
    @LABEL_IMPORTANT = "label label-important"

    if(filter.value == "null")
      filter.value = "/null"
    end
    itemURI = items_path(:old => @filters,:new => filter)
    if(filter.prop.starts_with? @OPEN_CALAIS_URI)
      itemClassFilter=getClassLabel(filter.prop[@OPEN_CALAIS_URI.length,filter.prop.length])
      #res= link_to filter.prop[@OPEN_CALAIS_URI.length,filter.prop.length], itemURI, :class =>  itemClassFilter
      res= link_to filter.value, itemURI, :class =>  itemClassFilter, title: filter.prop[@OPEN_CALAIS_URI.length,filter.prop.length]
    elsif(filter.prop.starts_with? @WIKI_META_URI)
      itemClassFilter=getClassLabel(filter.prop[@WIKI_META_URI.length,filter.prop.length])
      #res=link_to filter.prop[@WIKI_META_URI.length,filter.prop.length], itemURI, :class => itemClassFilter
      if(filter.value.rindex('/') == nil)
        res=link_to filter.value, itemURI, :class => itemClassFilter, title: filter.prop[@WIKI_META_URI.length,filter.prop.length]

      else
        res=link_to filter.value[filter.value.rindex('/')+1, filter.value.length], itemURI, :class => itemClassFilter, title: filter.prop[@WIKI_META_URI.length,filter.prop.length]
      end
    elsif(filter.prop.starts_with? @INSEE_GEO_URI)
      itemClassFilter=getClassLabel(filter.prop[@INSEE_GEO_URI.length,filter.prop.length])
      #res=link_to filter.prop[@INSEE_GEO_URI.length,filter.prop.length], itemURI, :class => itemClassFilter
      res=link_to filter.value[filter.value.rindex('/')+1, filter.value.length], itemURI, :class => itemClassFilter, title: filter.prop[@INSEE_GEO_URI.length,filter.prop.length]
    elsif(filter.prop.start_with? @RSS_URI+"source")
      itemClassFilter=getClassLabel(filter.prop[@RSS_URI.length,filter.prop.length])
      #res=link_to filter.prop[@RSS_URI.length,filter.prop.length], itemURI, :class => itemClassFilter
      res=link_to filter.value, itemURI, :class => itemClassFilter, title: filter.prop[@RSS_URI.length,filter.prop.length]
    elsif(filter.prop.start_with? @SVM_PLUGIN_URI)
      #res=link_to "category", itemURI, :class => @LABEL_INFO
      res=link_to filter.value, itemURI, :class => @LABEL_INFO, title: filter.value
    elsif(filter.prop.start_with? @TWITTER_HASHTAG_PLUGIN_URI)
      res=link_to "#"+filter.value, itemURI, :class => "btn-auth  btn-twitter", title: "#"+filter.value
    elsif(filter.prop.start_with? @TWITTER_MENTIONED_PLUGIN_URI)
      res=link_to "@"+filter.value, itemURI, :class => "btn-auth btn-twitter", title: "@"+filter.value
    end
  end

  def removeFilterFromList(list, filter)
    puts list.class
{'fraction_non_alphanumeric': 0.14182692307692307, 'fraction_numerical': 0.001282051282051282, 'mean_word_length': 4.602333931777379, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 33, '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': '3506259', 'n_tokens_mistral': 2230, 'n_tokens_neox': 2238, 'n_words': 305}