Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

terms() for subcorpora #209

Closed
ChristophLeonhardt opened this issue May 19, 2022 · 1 comment
Closed

terms() for subcorpora #209

ChristophLeonhardt opened this issue May 19, 2022 · 1 comment

Comments

@ChristophLeonhardt
Copy link
Contributor

ChristophLeonhardt commented May 19, 2022

These slides show a method to extract terms from a partition to then identify noisy terms.

This does not seem to work yet for subcorpora objects created with subset (using polmineR 0.8.6.9003).

m2008 <- subset("GERMAPARL", year == 2008 & speaker == "Angela Merkel" & interjection == FALSE)
terms(m2008, p_attribute = "word")

results in

Fehler in identical(p_attribute, x@p_attribute) :
kein Slot des Namens "p_attribute" für dieses Objekt der Klasse "plpr_subcorpus"

The error message is telling. terms() (for slice objects) checks early if the p-attribute passed in the function call is identical with a p-attribute in the p_attribute-slot of the subcorpus. But subcorpus has no p_attribute slot.

This still could be user error and I would be glad to learn how I could "enrich" these subcorpora with p_attributes if this would be the way to go.

ablaette pushed a commit that referenced this issue Aug 22, 2022
ablaette pushed a commit that referenced this issue Aug 23, 2022
@ablaette
Copy link
Collaborator

The method had been implemented for the slice virtual class, but the implementation actually only works for partition objects. So the method for subcorpus objects now relies on the method defined for partition.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants