nickduran / align-linguistic-alignment

Python library for extracting quantitative, reproducible metrics of multi-level alignment between speakers in naturalistic language corpora.
MIT License
40 stars 12 forks source link

[Feature] Add length of source and target utterance #28

Open fusaroli opened 6 years ago

fusaroli commented 6 years ago

Specific case study: with parent-child interactions one might wonder whether there are different patterns when excluding shorter or longer utterances. Therefore it'd be useful to add columns with this information. This is probably overkill for most adult-adult conversations, tho'.

nickduran commented 4 years ago

To do so, add the following lines of code to the returnMultilevelAlignment function in "calculate_alignmnet"

utterance_length1 = {}
utterance_length2 = {}

 # add number of tokens in each utterance
utterance_length1['utterance_length1'] = len(tok1)
dictionaries_list.append(utterance_length1.copy())   

utterance_length2['utterance_length2'] = len(tok2)
dictionaries_list.append(utterance_length2.copy())