replacing "&" with "&+" for phonological fragments

7 views
Skip to first unread message

Janet Bang

unread,
Jun 2, 2025, 6:21:37 PMJun 2
to chibolts
Hello,

I am preparing transcripts to contribute to CHILDES, and at the time of transcription we were using the "&" symbol for phonological fragments. 

Is there a code that we could use to automatically replace these to the "&+"? This was coming up as an error when using CHECK, and I was hoping to clear these to identify any other issues before contributing. 

Thank you!
Janet

Leonid Spektor

unread,
Jun 3, 2025, 2:54:13 PMJun 3
to chib...@googlegroups.com
Hi Janet,

Sorry for delay in reply. I remember that we had to do the same thing for our data and I vaguely remember we had a command to do it for many files at the time. But, unfortunately I cannot seem to find that command anywhere.


One suggestion I have to use BBEdit editor. It has a good Grep function which will help identify the right "&" symbols.


You can also do it in two passes. First, use the following command to replace all '&' symbols with '&+':

chstring -w +s"&" "&+" *.cha

Next use CHSTRING command to replace mistakes that the first command might have created. For example,

chstring -w +s"&+~" "&~" +s"&+=" "&=" +s"&+-" "&-" *.cha


Leonid.

--
You received this message because you are subscribed to the Google Groups "chibolts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chibolts+u...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/chibolts/837c4db2-b024-4b6a-a5d5-902d03eddf60n%40googlegroups.com.

Janet Bang

unread,
Jun 3, 2025, 4:10:39 PMJun 3
to chib...@googlegroups.com
Hi Leonid, 

Thanks! I was worried about using chstring because we also used the "&=" for simple events, but so would the second chstring command address that issue?

I'll also test this out a few files, rather than doing this to the whole corpus at once and let you know if I have any questions. 

Janet



--
Janet Y. Bang, Ph.D (she/her/hers)
Assistant Professor
Child and Adolescent Development
Lurie College of Education, San José State University

Leonid Spektor

unread,
Jun 3, 2025, 6:24:34 PMJun 3
to chib...@googlegroups.com
Hi Janet,

Yes, the second "chstring -w +s"&+~" "&~" +s"&+=" "&=" +s"&+-" "&-" *.cha" command would fix the &= option. The CHSTRING option +s"&+=" "&=" will do just that fix. The one thing you need to worry about is the file names. The first command does work on the *.cha file, but it will create output *.chstr.cex files. So, the second command will need an input file to be *.chstr.cex.

You can streamline the process if you backup your data files first. Then you can make the CHSTRING changes on the copy *.cha data files. In this case use following commands:

1st: chstring -w +s"&" "&+" +1 *.cha

2nd: chstring -w +s"&+~" "&~" +s"&+=" "&=" +s"&+-" "&-" +1 *.cha


In the end you can use FREQ command freq +o3 +u +s&* *.cha to get the full list of all &... codes in your data files. If you see any bad codes, then just use 2nd CHSTRING command to fix them too. Or run CHECK command.

Please, CHECK your data files in the end for errors and may be visually examine few files just to be sure that they look okay.


Leonid.

Janet Bang

unread,
Jun 11, 2025, 9:27:24 PMJun 11
to chib...@googlegroups.com
Thanks Leonid! I did a spot-check and it seemed to work well. 

Reply all
Reply to author
Forward
0 new messages