forked from SeedlingsBabylab/datavyu_scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
get_child.rb
23 lines (23 loc) · 947 Bytes
/
get_child.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
require 'Datavyu_API.rb'
begin
column = "labeled_object" # set this as necessary
allColumns = getColumnList()
column = allColumns[0]
puts column
col = getColumn(column)
child_column = createNewColumn("child_labeled_object", "object","utterance_type","object_present","speaker", "cell_number")
for cell in col.cells
if (cell.speaker.to_s == 'CHI') or (cell.object.to_s.start_with?("%com: mwu")) or (cell.object.to_s.start_with?("%com: first word"))
newcell = child_column.make_new_cell()
newcell.change_code("object", cell.object)
newcell.change_code("utterance_type", cell.utterance_type)
newcell.change_code("object_present", cell.object_present)
newcell.change_code("speaker", cell.speaker)
newcell.change_code("onset", cell.onset)
newcell.change_code("offset", cell.offset)
newcell.change_code("ordinal", cell.ordinal)
newcell.change_code("cell_number", cell.ordinal)
end
end
setColumn(child_column)
end