             expires: 100000 # Expiration Date (in seconds), 0 (default) means it ends with the current session
 
     return
-
-util.convertLMFFeatsToObjects = (structure, key) ->
-
-    # Recursively traverse a tree, expanding each "feat" array into a real object, with the key "feat-[att]":
-    if structure?
-        output = null
-        theType = util.findoutType(structure)
-        if theType is "object"
-            output = {}
-            $.each structure, (inkey, inval) ->
-                if inkey is "feat"
-                    innerType = util.findoutType(inval)
-                    if innerType is "array"
-                        $.each inval, (fkey, fval) ->
-                            keyName = "feat_" + fval["att"]
-                            if not output[keyName]?
-                                output[keyName] = fval["val"]
-                            else
-                                if $.isArray(output[keyName])
-                                    output[keyName].push fval["val"]
-                                else
-                                    output[keyName] = [output[keyName], fval["val"]]
-                            return
-
-                    else
-                        keyName = "feat_" + inval["att"]
-                        if not output[keyName]?
-                            output[keyName] = inval["val"]
-                        else
-                            if $.isArray(output[keyName])
-                                output[keyName].push inval["val"]
-                            else
-                                output[keyName] = [output[keyName], inval["val"]]
-                else
-                    output[inkey] = util.convertLMFFeatsToObjects(inval)
-                return
-
-        else if theType is "array"
-            dArr = new Array()
-            $.each structure, (inkey, inval) ->
-                dArr.push util.convertLMFFeatsToObjects(inval)
-                return
-
-            output = dArr
-        else
-            output = structure
-        output
-    else
-        null
-
-util.findoutType = (variable) ->
-    if $.isArray(variable)
-        "array"
-    else
-        typeof (variable)

        infixIndex
    ]

util.sblexArraytoString = (idArray, labelFunction) ->
    labelFunction = labelFunction or util.lemgramToString
    return _.map idArray, (lemgram) -> labelFunction lemgram, true

    # TODO: remove this if all is well with the lemgram dropdown
    # tempArray = $.map(idArray, (lemgram) ->
    #     labelFunction lemgram, false
    # )
    # out = $.map idArray, (lemgram) ->
    #     isAmbigous = $.grep(tempArray, (tempLemgram) ->
    #         tempLemgram is labelFunction(lemgram, false)
    #     ).length > 1
    #     labelFunction lemgram, isAmbigous
    # return out


util.lemgramRegexp = /\.\.\w+\.\d\d?(\:\d+)?$/
util.isLemgramId = (lemgram) ->
    lemgram.search(util.lemgramRegexp) isnt -1


    getTitle : (corpus) ->
        @struct[corpus.split("|")[1]].title

# TODO never use this, remove when sure it is not used
window.search = (obj, val) ->
