 
         ).appendTo(@element)
 
-    renderCorpusContent: (type, wordData, sentenceData, corpus_attrs, tokens) ->
+    renderCorpusContent: (type, wordData, sentenceData, corpus_attrs, tokens, customAttrs, customData) ->
         if type == "struct"
             pairs = _.pairs(sentenceData)
 

                    pairs.push([key, val])

        pairs = _.filter pairs, ([key, val]) -> corpus_attrs[key]

        pairs.sort ([a], [b]) ->
            ord1 = corpus_attrs[a].order
            ord2 = corpus_attrs[b].order
            # first three cases to handle ord1 or ord2 being undefined
            if ord1 == ord2
                return 0

        @element.html '<div id="selected_sentence" /><div id="selected_word" />'
        corpusObj = settings.corpora[corpus]


        $("<div />").html("<h4 rel='localize[corpus]'></h4> <p>#{corpusObj.title}</p>").prependTo "#selected_sentence"

        customData = pos: [], struct: []
        unless $.isEmptyObject(corpusObj.custom_attributes)
            [word, sentence] = @renderCustomContent wordData, sentenceData, corpusObj.custom_attributes, tokens
            customData.pos = word
            customData.struct = sentence

        posData = []
        unless $.isEmptyObject(corpusObj.attributes)
            posData = @renderCorpusContent "pos", wordData, sentenceData, corpusObj.attributes, tokens, corpusObj.custom_attributes or {}, customData.pos
        structData = []
        unless $.isEmptyObject(corpusObj.struct_attributes)
            structData = @renderCorpusContent "struct", wordData, sentenceData, corpusObj.struct_attributes, tokens, corpusObj.custom_attributes or {}, customData.struct

        $("#selected_word").append $("<h4>").localeKey("word_attr")
        $("#selected_sentence").append $("<h4>").localeKey("sentence_attr")
        $("#selected_word").append posData
        $("#selected_sentence").append structData

        @element.localize()
        @applyEllipse()
