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
I'm not entirely sure, what the internal problem is here, but the partition_bundle-method on context-objects returns a strange partition_bundle-object. As a result, all functions applied to the new pb-object fail (merge(), features(), as.DocumentTermMatrix()).
First hint at the problem: str(pb_a) returns the warning
Warnung in str.default(obj, ...)
'str.default': 'le' is NA, also als 0 betrachtet
... getting corpus positions
... number of hits: 1
... checking that all p-attributes are available
... getting token id for p-attribute: word
... generating contexts
... counting tokens
pb_a <- partition_bundle(cont_a)
|++++++++++++++++++++++++++++++++++++++++++++++++++| 100% elapsed = 00s
Warnung in str.default(obj, ...)
'str.default': 'le' is NA, so taken as 0
|++++++++++++++++++++++++++++++++++++++++++++++++++| 100% elapsed = 00s
Warnung in str.default(obj, ...)
'str.default': 'le' is NA, so taken as 0
dtm <- polmineR::as.DocumentTermMatrix(pb_a, col = "count")
... using the p_attribute-slot of the first object in the bundle as p_attribute: word
... generating (temporary) key column
... generating cumulated data.table
... getting unique keys
... generating integer keys
Fehler in simple_triplet_matrix(i = unname(i), j = DT[["j"]], v = DT[[col]], :
'i, j' invalid
The text was updated successfully, but these errors were encountered:
(And yes, i'm aware that a context, let alone a partition-bundle on a single hit is rather useless. I just wanted to exclude overlapping windows etc as a source for the error)
there are two kinds of issues we have (had) here: The first warning arises from missing sizes in the partition objects that are generated. That's fixed. The second one is that generating a TermDocumentMatrix requires names of the partitions in a partition_bundle to be present. The solution I chose now is to assign (increasing) integer numbers as names to the objects in a partition_bundle, if not present.
Should work now, with the next push to the dev branch.
I'm not entirely sure, what the internal problem is here, but the partition_bundle-method on context-objects returns a strange partition_bundle-object. As a result, all functions applied to the new pb-object fail (merge(), features(), as.DocumentTermMatrix()).
First hint at the problem:
str(pb_a)
returns the warningMinimal Example
cont_a <- context("GERMAPARL", query = 'Teilzeitzwangsgesetz', cqp = F)
pb_a <- partition_bundle(cont_a)
pb_a <- enrich(pb_a, p_attribute = "word", progress = TRUE)
dtm <- polmineR::as.DocumentTermMatrix(pb_a, col = "count")
The text was updated successfully, but these errors were encountered: