app/models/concerns/dri/solr/document/export.rb
# Exports the citation in DRI format
# @return [String] the citation as html-safe text
Exports the citation in DRI format
Exports the citation in DRI format
def citation_title(title_text)
    prepositions = %w(a about across an and before but by for it of the to with without)
  	new_text = []
  	title_text.split(' ').each_with_index do |word, index|
  	  if (index == 0 && word != word.upcase) ||
  	     (word.length > 1 && word != word.upcase && !prepositions.include?(word))
  	    new_text << word.split('-').map!(&:capitalize).join('-')
  	  else
  	    new_text << word
  	  end
  	end
  	new_text.join(' ')
  end
def citation_title ( title_text ) prepositions = %w( a about across an and before but by for it of the to with without ) new_text = [ ] title_text . split ( ' ' ) . each_with_index do | word , index | if ( index == 0 && word != word . upcase ) || ( word . length > 1 && word != word . upcase && ! prepositions . include? ( word ) ) new_text << word . split ( '-' ) . map! ( & :capitalize ) . join ( '-' ) else new_text << word end end new_text . join ( ' ' ) end
Exports the citation in DRI format
Exports the citation in DRI format
# the split("-") will handle the capitalization of hyphenated words
the citation as html-safe text
the citation as html - safe text
String
title_text