You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A bit tricky to describe, but the decode method isn't working anymore for slice objects because all structural attributes are overwritten by the last s-attribute which gets decoded in a previous step. The culprit seems to be line 248 in the declaration of the unfold function which says
value <- .SD[[s_attr]]
after which always the same "value" is used in:
for (s_attr in s_attributes) dt[, (s_attr) := value]
Workaround / Solution?
If I replace both lines with the pre-commit line, everything works as expected.
for (s_attr in s_attributes) dt[[s_attr]] <- rep(.SD[[s_attr]], times = nrow(dt))
I am not sure why the change was made though.
Reproducible example
In polmineR 0.8.0.9003 this might be an illustrative example for the problem before the fix. The resulting data.table is full of the speaker name:
gp_subset <- polmineR::subset("GERMAPARLMINI", date == "2009-10-28")
gp_subset_decode <- decode(gp_subset)
Edit: Also on the topic of modifying the decode method, in some instances it might be disadvantageous to remove the struc column from the token stream. Does that change serve a particular purpose?
The text was updated successfully, but these errors were encountered:
My apologies for the unwanted side-effects of my refactoring exercise for the decode()-method, and for you detailed feedback. The issue is fixed in the development version now, and I reverted to keeping the struc column.
Problem
A bit tricky to describe, but the decode method isn't working anymore for slice objects because all structural attributes are overwritten by the last s-attribute which gets decoded in a previous step. The culprit seems to be line 248 in the declaration of the unfold function which says
after which always the same "value" is used in:
Workaround / Solution?
If I replace both lines with the pre-commit line, everything works as expected.
I am not sure why the change was made though.
Reproducible example
In
polmineR 0.8.0.9003
this might be an illustrative example for the problem before the fix. The resulting data.table is full of the speaker name:Edit: Also on the topic of modifying the decode method, in some instances it might be disadvantageous to remove the struc column from the token stream. Does that change serve a particular purpose?
The text was updated successfully, but these errors were encountered: