Skip to content

Cannot export secondary attributes of SEGMENT level to TextGrid collection #264

@trblslp

Description

@trblslp

Using the demo data, first make a new attribute for the Phonetic level, called Phonetic2, and copy the annotations from the former to the latter using the update_itemsInLevel() function.

# add attribute def
add_attributeDefinition(ae,
                        levelName = "Phonetic",
                        name = "Phonetic2")
# query orig level
phones <- query(ae,
      "Phonetic =~ .*")
# change attribute name
phones <- phones %>% 
  mutate(attribute = "Phonetic2")
# use resulting seglist to populate annotations on new attribute
update_itemsInLevel(ae,
                    phones)

We now have annotations for the new attribute:

query(ae,
      "Phonetic2 =~ .*")

Screen Shot 2022-06-16 at 5 24 41 pm

Then export as a TextGrid collection:

export_TextGridCollection(ae,
                          targetDir = "./Export_demo",
                          attributeDefinitionNames = c("Phonetic", "Phonetic2", "Word", "Accent"),
                          timeRefSegmentLevel = "Phonetic")

But, there are in fact no annotations at all on the TextGrid tier corresponding to the new attribute. Note that it doesn't seem to matter here whether we specify the timeRefSegmentLevel or not (although specifying it as the Phonetic2 level throws an error). However, we do find annotations for secondary tiers if they are of the ITEM type, as we can see for the Accent tier.

Screen Shot 2022-06-16 at 5 18 45 pm

I suspect this issue bears some relation to this other one, but I can't say why.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions