Get list of Sentences from CSV

PennController for IBEX Forums Support Get list of Sentences from CSV

Tagged: , ,

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #9835
    Sa_Semi
    Participant

    Hello,

    I’m working on SPR study, where people read texts sentence by sentence. I used the following syntax so far:

    newController("DashedSentence", {s : ['This is sentence one.', 'This is the second sentence.']})
                .print()
                .log()
                .wait()
                .remove()
            ,
    

    It worked well, but now I want to save the list of sentences in a CSV to create different groups and items, so something like:

    newController("DashedSentence", {s : [row.text_1]})
                .print()
                .log()
                .wait()
                .remove()
            ,
    

    With the content of text_1 being: ‘This is sentence one.’, ‘This is the second sentence.’
    But since comma are used as separators, how do I save multiple sentences? Enclosing them all in ” caused all sentences to be displayed at once.

    I would appreciate help on this.

    #9837
    Jeremy
    Keymaster

    Hi,

    You have two options. One is to use one column per sentence, so if you have two sentences you need two columns instead of one for the sentences in your CSV file. Let’s say you name your first column text_1 and the second column text_2, then you would do newController("DashedSentence", {s : [row.text_1, row.text_2]})

    Another option is to use javascript to split the string coming from the table into multiple sub-strings. Assuming you are separating your sentences with the comma character (meaning no comma will ever occur as an actual punctuation in a sentence) then you would proceed like this: newController("DashedSentence", {s : row.text_1.split(',') })

    Jeremy

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.